The four techniques above score text with word counts you can check by hand. These methods replace that scoring with a model. They fix some of the failures you just saw and bring new ones. Adapters for each are included in the code, but none run on this page: local models are disabled, and remote ones need keys and your consent. Nothing below is a measured result.
Semantic ranking
BGE embeddings
Scores each sentence by how close its meaning is to the question, not its exact words.
question + each sentencebge-small-en-v1.5 embeds bothcosine similaritysame budget packer
- Would help here
- The synonym miss. “Money back on a yearly plan” and “full refund for annual subscriptions” share no words but are close in meaning.
- Watch out
- Close in meaning isn’t the same as needed. An exception that contradicts the question can score lower than a sentence that restates it.
Adapter included. Not run on this page: local models are off.
Model card ↗Learned word deletion
LLMLingua-2
A small classifier predicts, for every token, the probability that it should be kept. It was trained on compressions written by a large model.
textBERT-size token classifierkeep probability per wordkeep the most likely words
- Would help here
- Word deletion’s broken grammar: a trained model learns that “not” and “except” carry meaning.
- Watch out
- It never sees the question. At tight budgets it keeps what’s generally informative, which may be the wrong section.
Adapter included. Not run on this page: local models are off.
Paper ↗Perplexity pruning
LLMLingua
A small language model reads the text and drops the tokens it finds most predictable. Predictable tokens add little information.
textsmall causal LM (Phi-2 here)surprise per tokendrop the least surprising
- Would help here
- Trimming filler and boilerplate inside long passages, not just whole sentences.
- Watch out
- Question-blind. A rare-but-irrelevant detail looks surprising, so it may survive while the answer is pruned.
Adapter included. Not run on this page: local models are off.
Paper ↗Question-aware perplexity
LongLLMLingua
Asks how much each document makes the question more likely, ranks and reorders documents, then prunes tokens inside them.
question + documentssmall causal LMrank and reorder documentsprune tokens
- Would help here
- Many retrieved passages where the answer is buried in the middle, the case it was designed for.
- Watch out
- Several model passes per request add latency. Reordering changes what the answerer reads first.
Adapter included. Not run on this page: local models are off.
Paper ↗Model as relevance judge
Laya remote
Asks a remote model a typed yes/no question for each sentence (“is this relevant?”) and uses the probability as the score.
question + each sentenceremote model judgementprobability of “relevant”same budget packer
- Would help here
- Questions that need understanding rather than matching: “does this sentence change the answer?”
- Watch out
- One judgement per sentence costs time and money, and the probabilities need checking on real data.
Adapter included. Needs a configured remote server and your consent per call.
Project ↗Hosted service
Compresr Latte
Send text and the question to an API and get compressed text back. Paragraph or token-level modes, fixed or automatic ratio.
text + questionhosted APIcompressed text
- Would help here
- Production use without running models yourself.
- Watch out
- Your text leaves the device and each call is billed. The engine is closed, and the output has no offsets, so the lab can’t show exactly what was cut.
Adapter included. Needs an API key and your consent per paid call.
Docs ↗