LLM context windows have a marketed size and a useful size, and they're not the same number. Research shows quality degrades well before the window fills up - a 1M-token model starts losing reasoning fidelity around 400K tokens. Here's the research behind the Smart Zone, the Warn Zone, and the Dumb Zone - and a Claude Code statusline that tracks which one you're in.
Duncan Leung
📚 Learning, 👨🏻💻 Building, 📝 Documenting...
Hi! I'm Duncan Leung and I currently lead Frontend Engineering at Airvet.
In a previous career I worked overseas in Beijing as a Product Manager at a skunkworks studio building digital experience projects for Ford Motor (China) and consulted on UX projects for Starwood Hotels. During this time I also mentored startups at Chinaccelerator and ran startup events and hackathons in Shanghai.
👨🏻💻 I'm a self taught software developer, and this is a place for me to jot down some notes. I mostly cover Javascript, Typescript, React, and software development.
Latest Writing
- Read article
- Read article
The retrieval pipeline returned chunks that mentioned vaccination schedules but didn't contain the actual schedule data. The model saw evidence that was on-topic but empty of the answer - and correctly refused. The root cause wasn't the model, the reranker, or the query. It was the chunking strategy splitting tables and structured data away from the prose that named them.
- Read article
Same question, same branch, same retrieval, same 10 evidence chunks with identical rerank scores - and one deployment refused while another answered with full clinical detail. The root cause wasn't retrieval. It was the LLM making a borderline judgment call on evidence that covered half the question well and the other half barely at all.
- Read article
Vector search finds the right chunk but ranks it badly and waves through near-garbage that's vaguely on-topic. Reranking fixes that with a second model - a cross-encoder that reads the query and each chunk together instead of comparing two frozen vectors. The whole trick is affording an expensive judge by only running it on the cheap stage's survivors.
- Read article
A guide to set up a modern Python development environment using uv, the fast all-in-one tool from Astral that replaces pyenv, virtualenv, and Poetry.
Newsletter
Stay updated, receive the latest post straight to your mailbox