TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Exploring spaCy-based prompt compression for LLMs – thoughts welcome

1 pointsby metawakeabout 1 month ago

1 comment

metawakeabout 1 month ago
Hi HN,<p>I’ve been exploring whether prompt compression — done before sending input to LLMs — can help cut down on token usage and cost without losing key meaning.<p>Instead of using a neural model, I wrote a small open-source tool that uses handcrafted rules + spaCy NLP to reduce prompt verbosity while preserving named entities and domain terms. It’s mostly aimed at high-volume systems (e.g. support bots, moderation pipelines, embedding pipelines for vector DBs).<p>Tested it on 135 real prompts and got 22.4% average compression with high semantic fidelity.<p>GitHub: <a href="https:&#x2F;&#x2F;github.com&#x2F;metawake&#x2F;prompt_compressor">https:&#x2F;&#x2F;github.com&#x2F;metawake&#x2F;prompt_compressor</a><p>Would love feedback, use cases, or critiques!