The result is encouraging. The caveat is the point.
In a narrow synthetic retrieval task, a quantized 14B-parameter local language model returned the correct hidden code in every validated test—from the beginning, middle, or end of prompts ranging from roughly 4K to 24K tokens.
The result is meaningful, but it is not a demonstration of perfect long-context reasoning. The task involved finding a single clearly labeled identifier. And the highest-context setting had only one trial per insertion position.
Within these tested conditions, increasing prompt length to ~24K tokens did not cause an observed retrieval error. It did, however, increase mean end-to-end latency from 19.24 seconds at the 4K setting to 203.02 seconds at 24K—about 10.6× longer.
Perhaps the most instructive finding came from a failed earlier version: a prompt independently counted at 52,047 tokens was sent to a runtime configured for only 24,576 tokens. Retrieval appeared to fail at the beginning and middle. After correcting token budgeting, those positional failures disappeared in the tested ranges.
Does a larger context window mean usable memory?
Language models increasingly advertise longer context windows. But the number of tokens a model can nominally accept is not the same as the amount of information it can retrieve accurately, reason over, or process efficiently.
A simple place to start is the needle-in-a-haystack test: insert a unique fact into a longer document and ask the model to retrieve it. Repeating this across different prompt lengths and insertion positions provides a controlled measurement of one capability—locating a specific known fact.
We asked two related questions: can the model reliably find the needle as the prompt grows, and what happens to the time required to produce an answer?
Token-validating the experiment
The benchmark ran locally using Qwen3:14B (Q4_K_M quantization) served by Ollama 0.40.11 on an Apple M1 Max MacBook Pro with 64 GB unified memory. Inputs were assembled from generated synthetic research notes, with a unique verification code inserted near 0%, 50%, or 100% of the context.
Document: “… The secret verification code for Project Atlas is ATLAS-6378. …”
Question: “What is the secret verification code for Project Atlas?”
Expected: ATLAS-6378A retrieval pass required identifying the expected code, not merely mentioning an arbitrary code. Each completed condition was checked against Ollama's prompt_eval_count. Validated runs showed a consistent +16-token difference between the independent tokenizer and Ollama's reported count—small enough to indicate no large-scale truncation in these runs.
| Condition | Lengths | Depths | Trials / cell |
|---|---|---|---|
| Repeated evaluation | 4K, 8K, 10K | 0%, 50%, 100% | 5 |
| Long-context pilot | 24K | 0%, 50%, 100% | 1 |
The runtime context allocation was 24,576 tokens for the 4K–10K tests and 40,960 for the 24K pilot. The model's reported maximum context was 40,960 tokens; that number by itself is not an empirical reliability measure.
48 successful retrievals, across four context lengths
All 45 repeated trials at 4K–10K passed, as did all three trials at 24K. No accuracy decrease was observed with either context length or needle position in these particular tests.
Accuracy by context size and needle location
Every cell shows the number of successful trials, not merely a color-coded percentage.
Equally important, independently measured input lengths closely tracked the number of prompt tokens Ollama reported processing.
The intended prompts reached the model
Illustrative measurements from each context-length condition.
Retrieval stayed accurate. Waiting time did not stay flat.
The biggest observable trade-off was end-to-end response latency. On the tested hardware, average request time climbed markedly with longer inputs.
Mean wall-clock latency rises with input length
Bars show mean response time across trials. The 24K estimate is based on only three requests.
Individual requests are not equally fast
Each dot is a measured request. The three orange dots are the 24K pilot.
| Context target | Trials | Mean latency | Median |
|---|
The ~24K pilot took 174.46 seconds at the middle position, 187.59 seconds at the end, and 247.00 seconds at the beginning. With one trial at each depth, these differences should not be interpreted as evidence that the needle's position causes slower inference.
A false story about “lost-in-the-middle”
Before the token-aware benchmark, an earlier experiment appeared to show a dramatic pattern: the model missed needles at the beginning and middle, but found needles near the end.
That was tempting to explain as a model memory limitation. The experimental setup, however, contained an overriding flaw.
52,047 input tokens vs. a 24,576-token allocation
An independently counted input was more than twice the configured context capacity.
The early failures cannot be used to claim that Qwen3:14B has a beginning- or middle-position retrieval deficit. The prompt exceeded the allocated context. The later token-validated evaluation did not reproduce the same failure pattern within its tested input range.
There was a second measurement lesson: one end-position response included the correct code inside a complete sentence, yet an overly strict exact-string evaluator labeled it incorrect. Separating factual retrieval from output-format compliance prevented that scoring error from masquerading as a model failure.
What should we infer—and what should we not?
The study provides good evidence that this particular model and inference configuration can retrieve a single clearly marked fact from synthetic prompts of roughly 4K–24K tokens. It also documents a substantial wall-clock latency penalty as inputs become longer.
It does not establish that longer-context understanding, multi-document reasoning, or information integration is perfect. Needle retrieval asks the model to locate a conspicuous identifier. A real document-analysis system might have to resolve contradictions, compare versions of a policy, or infer a conclusion from distant passages.
Three distinct engineering questions
| Question | What this study established |
|---|---|
| Can the system accept the input? | Validated at ~24K under a 40,960-token allocation |
| Can it retrieve one labeled fact? | 48/48 observed successes within tested conditions |
| Can it reason over all the information? | Not measured |
There is also an architectural implication. Sending an entire document directly to a model can avoid a separate search stage, but makes the model process more tokens. Retrieval-augmented generation (RAG) can reduce the context passed to the model, but risks selecting the wrong passages. Which architecture is better depends on the complete system, not on context size alone.
Important reasons not to overgeneralize
Synthetic data. The documents were generated for a controlled retrieval task and are not a representative sample of contracts, scientific papers, codebases, or defect histories.
Narrow success criterion. Exact single-code retrieval is much easier than synthesis, reasoning, contradicting-evidence resolution, or following complex instructions.
Limited sample size. There were five trials per cell at 4K–10K and only one per cell at 24K. The 100% figures are observed proportions, not guarantees of future performance.
One model and one machine. No cross-model, quantization, hardware, or model-server comparison was performed.
Latency was observational. Caching, process scheduling, model warm-up, and execution order were not isolated with controlled repetitions.
Unmeasured lengths. The study did not test 30K or 40K retrieval. The maximum validated input was approximately 24K tokens.
These results do not prove that Qwen3:14B has perfect long-term memory, that all information in a 24K context is understood, that RAG is always faster or more accurate, or that the model is reliable for higher-stakes decisions.
From retrieving a code to evaluating understanding
To estimate effective context capacity more meaningfully, future experiments should move beyond one conspicuous needle. Useful next steps include injecting semantically similar distractors, asking multi-hop questions requiring evidence from multiple positions, comparing full-context prompting against RAG, and measuring confidence intervals with more independent tasks and document sources.
A more rigorous latency follow-up should randomize warm/cold-cache conditions, repeat the same prompts under consistent runtime states, and break down prompt_eval_duration and eval_duration instead of relying solely on wall-clock time.
Inspect the evidence
This article uses the 48 individual recorded requests shared from the local benchmark, not a hypothetical dataset. The results include 45 repeated trials across 4K/8K/10K and a three-request pilot at 24K.
Example commands
ollama pull qwen3:14b
python -m pip install requests transformers tokenizers pandas matplotlib
python benchmark_v3.py --dry-run
python benchmark_v3.pyExact benchmark parameters and test inputs should be saved alongside the results for replication. A successful dry run validates generated prompts before they are passed to Ollama.
External methodological reference: LeonEricsson/llmcontext, a separate needle-in-a-haystack implementation. This is an independently developed local evaluation, not a reproduction of all that project's settings.
Editorial layout reference: METR's research article inspired the evidence-first structure (motivation, methodology, results, discussion, limits). This report is not affiliated with METR; its text, figures, and conclusions are original.
Data provenance: User-supplied local terminal results, combined into 48 records. All four reported context groups use the same local model family, but the 24K context was allocated more runtime space than the 4K–10K set.