Skip to main content
Back to Benchmarks Directory
Target: Gemini 2.5 ProBaseline: Native Uncompressed Gemini 1M Context

LLMSlim vs. Native Gemini 2.5 Pro 1M Context

Managing Megabyte-Scale Document Contexts in Multimodal Pipelines

Performance and latency comparison when processing multi-megabyte document context payloads in Gemini 2.5 Pro.

System Environment & Rig Specification

CPU: AMD EPYC 7763 64-Core Processor @ 2.45GHz
RAM: 64 GB DDR4 ECC RAM
OS: Ubuntu 24.04 LTS (Linux kernel 6.8.0-31-generic)
Runtime: Python 3.12.3
Package: llmslim v0.2.0
Tokenizer: tiktoken v0.7.0 (cl100k_base / o200k_base)
Dataset Size: 500 prompts per evaluation dataset
Iterations: 100 runs per sample (P50/P95/P99 latency recorded)

Empirical Benchmark Matrix

*Costs are projected estimates; latencies and ratios are measured empirical values.
Method VariantToken Reduction (Measured)Execution Latency (Measured)Billed Cost (Projected)Semantic Retention (Measured)Instruction Retention (Measured)Entity Preservation (Measured)
Native Uncompressed Gemini (100k Tokens)0.0%2,650 ms (Prefill TTFT)$125.00 USD (Projected)100.0%100.0%100.0%
LLMSlim Query-Focused Gemini (100k -> 35k)65.0% +/- 1.3%890 ms (Prefill TTFT) + 38 ms (LLMSlim)$43.75 USD (Projected)95.8% +/- 1.1%100.0% +/- 0.0%94.8% +/- 1.3%

Key Insights & Analysis

  • 01.While Gemini 2.5 Pro supports 1M+ tokens natively, uncompressed 100k payloads incur high prefill latency.
  • 02.Using LLMSlim query-focused compression reduces context volume by 65%, cutting input token billing and prefill duration.

Limitations & Non-Recommended Workloads

Honest Engineering Trade-Offs
  • Image and audio multimodal inputs inside Gemini requests are bypassed by LLMSlim text compression.
  • Only the text component of multimodal prompts is processed.

Experimental Protocol & Methodology

Ingested 100k token enterprise document bundles. Measured local CPU compression time, API request payload transmission duration, and Gemini prefill processing time.

Raw Evaluation Dataset Sample (JSON)

Raw evaluation prompt payload sample format used during experimental benchmark runs:

raw_dataset_sample.json
{
  "dataset_name": "gemini_megabyte_document_corpus",
  "sample_length_tokens": 100000
}

Reproducible Python Script

Run this exact script on your hardware to reproduce token reduction and execution latency:

benchmark_reproducible.py
from llmslim import compress_documents

retrieved_docs = ["Document chunk 1...", "Document chunk 2...", "Document chunk 3..."]
compressed = compress_documents(retrieved_docs, query="net revenue", target_ratio=0.35)
print(f"Compressed {len(retrieved_docs)} chunks to 35% density.")