chunklaya: why Laya stops reading after ~200 tokens, and a chunking harness that fixes it
Measures the decision head's attention drop-off on long inputs across 400 documents, then chunks, screens and aggregates, or locates the one passage that matters.
# chunklaya Long-input harness for [Laya](https://github.com/NandhaKishorM/laya), the open-weights System 1 decision model: typed questions — `noul`, `choice`, `score` — answered over one piece of text in a single forward pass, no autoregression. It's the open answer to TypeSafe's closed Jev. Laya's checkpoints are configured for 512–1024 tokens, and Jev reads 32k. So what happens if you just feed Laya more text? Not what you'd guess. The encoder handles long input fine — it's pretrained to 8192 tokens. The problem is the decision head sitting on top of it, and it's a weirder failure than "runs out of context": past roughly the first 200 tokens, it stops paying attention to anything you give it. A fact buried in the middle of a long document is effectively invisible to it. This repo measures that failure precisely, then fixes it: chunk the input into passages, screen each one, combine the results — or, when the question names something you can search for, locate the one passage that matters and let Laya read just that. Tested on 400 documents with real confidence intervals, at no extra cost over just cranking up the context window, and now against Jev on a public needle benchmark (below). The narrative version is in [WRITEUP.md](WRITEUP.md), if you want the story instead of the reference. ## What you get over plain Laya | | Plain Laya | + chunklaya | |---|---|---| | Classify or rate a long, coherent document | Fine up to 4096 tokens once you raise `max_len` (0.98–0.99 acc) | No change needed | | Find whether something occurs anywhere in a long, multi-part input | Chance past the first ~200 tokens (AUC 0.51, CI includes 0.5) | 0.88 at every position, no filtering; 1.000 once known label noise is removed | | How precise the per-passage detector is | The default `nou