{"slug": "show-hn-tokenpath-token-level-citations-for-llm-output-read-from-attention", "title": "Show HN: TokenPath – token-level citations for LLM output, read from attention", "summary": "TokenPath, a new tool for token-level citation in LLM outputs, reads attention from any model to resolve claims to exact source spans. On the LongBench-Cite benchmark, it scores 0.815 F1, matching Anthropic's Citations API (0.812) and coming within 0.04 of a prompted frontier LLM (0.851), while being ~7× cheaper and ~5–6× faster. The tool works with any decoder LLM's output via a single API call, requiring no retraining or vendor lock-in.", "body_md": "# Grounding for your\n\nAI agent.\n\nResolve every claim in a model's answer to the exact source span behind it, at token-level granularity. Works with any model's output — attribution is one API call after the answer, and nothing about your stack changes.\n\nThis letter agreement (the \"Agreement\") is made effective as of March 2, 2026 between Acme Robotics, Inc. (the \"Company\") and Jordan Lee. You are offered the role of Senior Mechanical Engineer. Your first day of employment will be March 2, 2026.\n\nQ · When does the agreement start, and when is my first day of work?\n\nThe agreement is effective as of March 2, 2026, and your first day of employment is March 2, 2026.\n\nClaimMarch 2, 2026resolves to“March 2, 2026”confidence0.99\n\nBoth claims read “March 2, 2026” — each resolves to a different source span. One call returns the source and confidence behind every claim.\n\n## The one-minute tour.\n\n## Three ways to attach a citation.\n\nThey differ in what they measure.\n\n### Ask the model\n\nHave the LLM footnote itself. Straightforward, no extra infrastructure.\n\nNo granularity. Points at a few numbered sources at best — never the exact cell or sentence inside a long document.\n\n### Retrieve and re-rank\n\nPull the relevant chunks and re-rank them with an embedding model — the standard RAG path, and it scales.\n\nCan't disambiguate. When the same fact, number, or date appears in two places, it can't tell which one the answer used — common in tables and financial docs.\n\n### Read the attention\n\nGranular. Resolves to the exact span — the right cell, the right sentence — character-precise.\n\nUnambiguous. Points at the specific occurrence the answer used, even when the same value appears a dozen times.\n\nFast. One forward pass over the context — no extra generation, no reranker round-trips. A 20k-token document resolves in under two seconds; scales to 128k tokens.\n\n## Frontier-grade citations, without the frontier bill.\n\nOn [LongBench-Cite](https://github.com/THUDM/LongCite) — one shared answer, one judge — reading attention post-hoc scores 0.815 F1: it matches Anthropic's Citations API (0.812) and lands within 0.04 of a prompted frontier LLM (0.851), while doing it ~7× cheaper and ~5–6× faster— on any model's answer, without regenerating it.\n\n[Read the full benchmark](/blog/longbench-cite-benchmark)\n\n## How it works\n\n### Send what the model read, what it wrote, and the claims.\n\nOne request: the source document, the question, the answer any decoder LLM produced, and the answer spans you want sourced. No retraining, no logprobs, no vendor lock on the generating model.\n\n```\nPOST /v1/attributions\n{\n  \"document\": \"In Q3, Northwind's revenue grew 18%…\",\n  \"question\": \"How fast did revenue grow?\",\n  \"answer\": \"Revenue grew 18% year over year.\",\n  \"spans\": [[13, 16]]  # the claim \"18%\"\n}\n```\n\nWorks with output from any model — yours, OpenAI's, Anthropic's.\n\n### We trace attention through the model.\n\nTokenPath runs an instrumented forward pass and reads where the model actually looked — token-level attention, distilled down to character-level evidence.\n\n### Get a source span and score per claim.\n\nTokenPath aggregates the attention under each answer span and returns the document span behind it, plus an attribution confidence. Render citations, attach provenance, and keep audit receipts.\n\n```\n{ \"spans\": [{\n  \"answer\": { \"start\": 13, \"end\": 16, \"text\": \"18%\" },\n  \"source\": {\n    \"start\": 32, \"end\": 35, \"text\": \"18%\",\n    \"confidence\": 0.82\n  }\n}] }\n```\n\nWant the full token×token attention behind it? Call `/v1/attributions/heatmap`\n\nfor the raw matrix.\n\n…In Q3, Northwind's revenue grew 18% year over year to $42.1M, driven primarily by…\n\n```\nPOST /v1/attributions\n{\n  \"document\": \"In Q3, Northwind's revenue grew 18%…\",\n  \"question\": \"How fast did revenue grow?\",\n  \"answer\": \"Revenue grew 18% year over year.\",\n  \"spans\": [[13, 16]]  # the claim \"18%\"\n}\n```\n\nWorks with output from any model — yours, OpenAI's, Anthropic's.\n\n```\n{ \"spans\": [{\n  \"answer\": { \"start\": 13, \"end\": 16, \"text\": \"18%\" },\n  \"source\": {\n    \"start\": 32, \"end\": 35, \"text\": \"18%\",\n    \"confidence\": 0.82\n  }\n}] }\n```\n\nWant the full token×token attention behind it? Call `/v1/attributions/heatmap`\n\nfor the raw matrix.\n\n…In Q3, Northwind's revenue grew 18% year over year to $42.1M, driven primarily by…\n\n## A primitive, not a UI.\n\nNo SDK required to start — it's one HTTPS endpoint. Send the document, the question, the answer, and the claim spans you care about; get the exact source span and a confidence behind each claim back, and cite, highlight, or log it in a few lines. Need the raw token heatmap instead? It's one call away at `/v1/attributions/heatmap`\n\n. Rate limits, usage metering, and key management come with the platform.\n\n```\n# one call — resolve each claim to its source\ncurl https://api.tokenpath.ai/v1/attributions \\\n  -H \"Authorization: Bearer $TOKENPATH_API_KEY\" \\\n  -d '{\n    \"document\": \"In Q3, Northwind's revenue grew 18%…\",\n    \"question\": \"How fast did revenue grow?\",\n    \"answer\": \"Revenue grew 18% year over year.\",\n    \"spans\": [[13, 16]]   # the claim \"18%\"\n  }'\n# one resolved source span per claim\n{ \"spans\": [{\n  \"answer\": { \"start\": 13, \"end\": 16, \"text\": \"18%\" },\n  \"source\": {\n    \"start\": 32, \"end\": 35, \"text\": \"18%\",\n    \"confidence\": 0.82   # attribution confidence\n  }\n}] }\n```\n\n## A dollar per million tokens. That's the pricing model.\n\nUsage-based, no monthly minimum, 10M tokens free when you sign up. Volume pricing and dedicated deployments for enterprises.\n\n## Still wondering if TokenPath is right for you?\n\nAsk your favorite LLM what we do, then make an informed decision.\n\n## Citation for the agentic era.\n\nFootnotes and citations were built for people — and people can only read so much. Agents read far more, and as we offload more work to them, being able to audit what they actually used matters. Some of that auditing will be done by agents too. We're building the layer underneath: the attribution signal, at the token level, read from the model's attention.\n\n10M free tokens · no card required\n\n## Talk to us\n\n15–30 min — bring your stack, we'll show you attribution on your own docs.", "url": "https://wpnews.pro/news/show-hn-tokenpath-token-level-citations-for-llm-output-read-from-attention", "canonical_source": "https://tokenpath.ai", "published_at": "2026-07-21 19:48:06+00:00", "updated_at": "2026-07-21 20:12:47.019275+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-tools", "ai-research"], "entities": ["TokenPath", "Anthropic", "LongBench-Cite", "Acme Robotics", "Jordan Lee"], "alternates": {"html": "https://wpnews.pro/news/show-hn-tokenpath-token-level-citations-for-llm-output-read-from-attention", "markdown": "https://wpnews.pro/news/show-hn-tokenpath-token-level-citations-for-llm-output-read-from-attention.md", "text": "https://wpnews.pro/news/show-hn-tokenpath-token-level-citations-for-llm-output-read-from-attention.txt", "jsonld": "https://wpnews.pro/news/show-hn-tokenpath-token-level-citations-for-llm-output-read-from-attention.jsonld"}}