Rewriting long documents

Hey, I’m surprised I couldn’t find a similar question as it seems common, I have a prompt to rewrite text, for example “fix grammar” or “explain like I’m 5”.

The problem occurs when the document is too large for the model.

What’s the best option? Rewrite by chunks? Will probably fail, for example if there is some information in the first chunk that is absent in the second …

Maybe there are some hacks to remove unnecessary words and the model will figure out how to rewrite properly?

Thanks :slight_smile:

Especially prompts like "Fix grammar"should easily be able to be split in chunks. The only thing you should still think about is what to do with sentences which are split in the middle.

“Explain like I’m 5” there might be some info which is missed in other chunks, but still I think it is not a problem in 80% of the cases.

David Shapiro has a video of recursive summarization on his YouTube channel that you should watch. It explains the best method for now

2 Likes

Thanks :slight_smile:

2 Likes