Problem-specific
QA compression
Question answering with LLMs sends evidence documents and the user question. Compression removes evidence irrelevant to the specific question.
QA compression pipeline
from supercompress import Compressor
comp = Compressor()
def answer_question(evidence_docs, question):
# Keep only the evidence lines that help answer the question
combined = "\n\n".join(evidence_docs)
result = comp.compress(combined, question)
return llm.generate(
f"Question: {question}\nEvidence:\n{result.compressed_text}"
)
Frequently asked questions
Does compression improve QA accuracy?
Often yes. Removing irrelevant evidence helps the LLM focus on the lines that actually contain the answer.
Can I use this with retrieval-based QA?
Yes. Compress retrieved passages before the LLM generates the answer.
Build with less context
Put compression in front of your next LLM call.
Use the hosted API or run SuperCompress locally. Keep the evidence, drop the token waste, and measure the savings before it reaches your model.