LLMs aren’t struggling with intelligence, they’re suffocating under too many useless tokens. Even a million-token context window can choke on long documents and multi-step agent chains.
But here’s the twist: most of those tokens are predictable grammar the model doesn’t even need.
Telegraphic Semantic Compression (TSC) cuts out the linguistic fluff and keeps only the high-value facts; names, numbers, entities, relationships. The stuff LLMs can’t reconstruct on their own.
In this article, you’ll see how TSC works, how it slashes context size without losing meaning, and how to implement it in Python.
What Is Telegraphic Semantic Compression (TSC)?
Telegraphic Semantic Compression (TSC) is a lossy semantic compression technique that removes predictable grammatical structure while preserving the high-entropy, fact-rich details that actually carry meaning.
Unlike traditional summarization, which often omits or rephrases important information, TSC retains all meaningful data points. It simply expresses them in a compact, telegraphic style, similar to classic “telegram language.”
Before → After Example
Original:
“The Eiffel Tower, located in Paris, France, was built in 1889 for the Exposition Universelle.”
TSC Output:
Eiffel Tower. Paris France. Built 1889. Exposition Universelle.
The core meaning remains fully intact. Only the predictable grammar is removed.
Visual Overview: The TSC Pipeline
To understand Telegraphic Semantic Compression (TSC) at a glance, here’s a step-by-step breakdown of how raw text is transformed into compact, fact-dense telegraphic form.
The diagram illustrates how predictable grammar is stripped away while high-entropy, meaning-bearing tokens are preserved and recombined into concise semantic fragments.
How to Read the Diagram
Input Text → Tokenization: The text is broken into tokens; words, punctuation marks, and linguistic units.
Filtering Predictable Grammar: Articles (“the”, “a”), prepositions (“of”, “in”), auxiliary verbs (“was”, “is”), and other low-information tokens are removed. These convey structure, not meaning.
Preserving High-Entropy Tokens: Important words; nouns, verbs, numbers, entity names, and domain-specific vocabulary; are preserved. These contain the unpredictable, fact-rich information an LLM cannot guess.
Recombining into Telegraphic Phrases: The retained tokens are assembled into short, dense fragments that resemble classic telegram language. The phrasing is minimal, but the semantics remain intact.
Output: Compressed TSC Text: The final result is dramatically shorter yet semantically rich, ideal for long-context LLM pipelines and multi-step reasoning workflows.
Why Telegraphic Semantic Compression Works So Well for LLMs
Large Language Models excel at predicting and reconstructing natural language. After training on trillions of sentences; grammar, syntax, and common phrasing are almost trivial for them to generate. In practice, LLMs do not need reminders about how English works, they can effortlessly restore the connective tissue of a sentence.
What LLMs can’t easily infer, however, is the unpredictable, fact-dense content that carries a text’s actual meaning.
These are the details that must be preserved explicitly:
- Dates: Years, timestamps, eras, historical markers.
- Names: People, cities, organizations, products.
- Rare or domain-specific terms: Specialized vocabulary or low-frequency words.
- Technical language: Jargon, formulas, measurements, scientific terms.
- Numerical relationships: Counts, ratios, quantities, comparative values.
- Niche domain facts: Information unlikely to appear in generic training data.
Telegraphic Semantic Compression (TSC) exploits this asymmetry. It removes what an LLM can reliably predict; grammar, filler words, and structural glue; while preserving the information it cannot reconstruct from context.
The result is that more of your context window is spent on meaningful, high-entropy information, instead of predictable linguistic scaffolding.
By leaning on the model’s natural talent for regenerating fluent English, TSC produces dramatically denser and more efficient prompts without sacrificing the factual integrity of the original text.
Python Implementation: Compress and Measure Token Savings
Below is a minimal-but-functional Telegraphic Semantic Compression (TSC) pipeline built with spaCy.
We’ll also measure token counts before and after compression using tiktoken to quantify how much context you save when using TSC inside LLM prompts.
This makes it easy to evaluate efficiency gains in real workflows.
Install Prerequisites
pip install spacy tiktoken
python -m spacy download en_core_web_sm
This installs the required dependencies by adding spaCy and tiktoken, then download the English language model for spaCy.
Basic TSC Compressor
import spacy
import tiktoken
# Load spaCy English model
nlp = spacy.load("en_core_web_sm")
# Parts of speech to remove (predictable grammar)
REMOVE_POS = {"DET", "ADP", "AUX", "PRON", "CCONJ", "SCONJ", "PART"}
# Optional low-information words to remove
REMOVE_LIKE = {"like", "just", "really", "basically", "literally"}
def tsc_compress(text: str) -> str:
"""Telegraphic Semantic Compression: remove predictable grammar, keep facts."""
doc = nlp(text)
chunks = []
for sent in doc.sents:
words = [
token.lemma_
for token in sent
if (
token.pos_ not in REMOVE_POS
and token.text.lower() not in REMOVE_LIKE
and not token.is_punct
)
]
if words:
chunks.append(" ".join(words))
return ". ".join(chunks) + "."
def count_tokens(text: str, model: str = "gpt-4") -> int:
"""Estimate the number of tokens using tiktoken."""
enc = tiktoken.encoding_for_model(model)
return len(enc.encode(text))
Example Usage With Token Count
text = """
The Eiffel Tower, located in Paris, France, was built in 1889 for the Exposition Universelle.
"""
compressed = tsc_compress(text)
original_tokens = count_tokens(text)
compressed_tokens = count_tokens(compressed)
reduction = (original_tokens - compressed_tokens) / original_tokens * 100
print("Original Text:\n", text.strip())
print("\nCompressed Text:\n", compressed)
print(f"\nOriginal Tokens: {original_tokens}")
print(f"Compressed Tokens: {compressed_tokens}")
print(f"Token Reduction: {reduction:.1f}%")
This generates this output:
Original Text:
The Eiffel Tower, located in Paris, France, was built in 1889 for the Exposition Universelle.
Compressed Text:
Eiffel Tower locate Paris France build 1889 Exposition Universelle
.
Original Tokens: 26
Compressed Tokens: 18
Token Reduction: 30.8%
Key Points
- TSC removes low-information tokens (articles, prepositions, pronouns, filler words, auxiliary verbs).
- All fact-rich tokens (names, numbers, events, domain terms) are preserved.
- Token savings are often 30–50%, sometimes more for longer passages.
- This allows LLMs to store more meaning per token, improving long-context performance.
- You can optionally remove more predictable verbs (like “locate”) for even stronger compression.
Example With a Longer Paragraph
Original Text:
The Amazon rainforest, often referred to as the lungs of the Earth, spans across nine countries in South America and is home to over 400 billion individual trees representing around 16,000 species.
It plays a critical role in regulating the global climate by absorbing carbon dioxide and producing oxygen.
In addition, the forest is home to countless animal species, many of which are endangered, and supports the livelihoods of millions of people who depend on it for food, shelter, and medicine.
Deforestation, driven by logging, agriculture, and mining, poses a significant threat to this unique ecosystem.
Compressed Text:
Amazon rainforest often refer lung Earth span nine country South America home 400 billion individual tree represent 16,000 specie
. play critical role regulate global climate absorb carbon dioxide produce oxygen
. addition forest home countless animal specie many endanger support livelihood million people depend food shelter medicine
. Deforestation drive log agriculture mining pose significant threat unique ecosystem
.
Original Tokens: 122
Compressed Tokens: 73
Token Reduction: 40.2%
Observations
- High token savings: Nearly 40% of the context footprint disappears
- Meaning preserved: Entities, numbers, relationships, and domain-specific terms remain fully intact.
- LLM-friendly: TSC text is short, dense, and easy for models to expand back into natural language.
- Scales to large documents: Multi-paragraph or multi-page content often compresses even more efficiently because repetitive grammar compounds.
Source Code
Full source code can be downloaded here: https://github.com/nunombispo/TelegraphicSemanticCompression-Article
End-to-End Workflow: From Raw Text to Full LLM Output
Telegraphic Semantic Compression (TSC) isn’t just a text compression tool, it’s part of a pipeline designed to maximize LLM efficiency.
By compressing text before sending it to the model, you can drastically reduce token usage, fit more meaningful information into the context window, and maintain the full reasoning power of the LLM.
The diagram below shows the workflow from user input to the final LLM-generated output:
How It Works
User Input: The user provides the original, uncompressed text, this could be a document, transcript, or multi-paragraph content.
TSC Compression: The compressor strips away predictable grammar, filler words, and low-value tokens, while preserving high-entropy facts and entities. The output is dense, telegraphic text.
Compressed Text Returned: The compressed text is compact and optimized for token efficiency, allowing more content to fit in LLM context windows without losing critical details.
Send to LLM: The user passes the compressed text along with any instructions or tasks to the LLM.
LLM Reconstructs Full Output: Using its language understanding, the model rebuilds fluent, human-readable text from the compressed facts, reintroducing grammar and context as needed.
Benefits of This Workflow
Token Efficiency: Fewer tokens are needed, leaving space for more context or longer documents.
Preservation of Meaning: Only predictable, low-information tokens are removed; all essential facts are retained.
Scalable Pipelines: Works well in multi-turn agents, RAG systems, or any workflow that passes large amounts of text repeatedly.
Minimal Human Effort: Users interact with fluent outputs without worrying about compression or token limits.
This pipeline essentially lets you store and transmit only the meaningful content, leaving the LLM to “flesh out” fluent text. It’s a clear example of leveraging LLM strengths rather than fighting them, maximizing both efficiency and output quality.
When to Use Telegraphic Semantic Compression (TSC)
TSC is a specialized tool designed to maximize token efficiency while preserving factual content.
However, it’s not a one-size-fits-all solution. Knowing when to use it, and when not to, is key to getting the most value.
Best Use Cases
Retrieval-Augmented Generation (RAG): When retrieving documents or knowledge chunks for an LLM, token budgets are limited. TSC allows you to pass more content without summarizing away critical details. Facts, dates, and entities remain intact, ensuring precise retrieval.
Long-Context Multi-Step Agents: Agents that carry state across multiple LLM calls often hit context limits quickly. Compressing intermediate states or prior conversation history with TSC lets agents operate longer without losing essential factual information.
Summaries That Must Preserve All Facts: Unlike typical summarization, which can inadvertently drop key details, TSC ensures every meaningful element is retained. Ideal for scientific reports, meeting notes, or technical documentation where accuracy is critical.
Ephemeral State Passed Between LLM Calls: Multi-agent pipelines often pass structured or unstructured state between calls. Compressed TSC text reduces token usage while still allowing the LLM to reconstruct full context on demand.
Compression of Transcripts or Large Documents: Audio transcripts, lecture notes, or multi-page documents often contain repetitive or predictable language. TSC distils the content into dense, meaningful chunks, freeing space for analysis, reasoning, or summarization by the LLM.
When to Avoid Using TSC
TSC is not suitable for text where nuance, style, or tone conveys meaning. Applying it in these contexts can strip away the very elements that make the text meaningful:
Poetry: Rhythm, rhyme, and literary devices are lost.
Jokes or Humor: Timing, wordplay, and puns are removed, ruining the punchline.
Emotional or Persuasive Writing: Tone, emphasis, and subtlety disappear, which may distort intent.
Legal or Contractual Text: Every word matters. Small omissions can alter meaning, so use extreme caution.
Final Thoughts
Telegraphic Semantic Compression (TSC) transforms verbose natural language into dense semantic packets, stripping away grammatical scaffolding while preserving the core informational payload. It relies on a simple insight about modern LLMs: grammar is cheap. These models can reconstruct fluent language effortlessly from fragments, but they cannot invent the high-entropy facts that truly matter; names, numbers, entities, technical terms, and relationships.
By removing predictable, low-information tokens and keeping only the unpredictable, fact-rich content, TSC provides a practical way to shrink context size without shrinking meaning. Each token carries more value, unlocking deeper reasoning, larger RAG contexts, and more efficient multi-agent pipelines.
For developers and researchers pushing against context limits or building AI systems that must pass intermediate state between steps, TSC is a clean, elegant, and surprisingly powerful optimization technique. It is not a replacement for summaries, embeddings, or traditional compression; instead, it occupies a unique niche: fact-preserving, loss-resistant compression that LLMs can decode perfectly on demand.
Experimenting with TSC may reveal that a little telegraphic “skeleton language” goes a very long way, letting your models focus on what truly matters while freeing up precious context space.
Follow me on Twitter: https://twitter.com/DevAsService
Follow me on Instagram: https://www.instagram.com/devasservice/
Follow me on TikTok: https://www.tiktok.com/@devasservice
Follow me on YouTube: https://www.youtube.com/@DevAsService


Top comments (0)