Skip to content

The usage log says which call it was - #996

Merged
WaylandYang merged 2 commits into
devfrom
chore/llm-usage-says-which-call
Sep 28, 2026
Merged

WaylandYang merged 2 commits into
devfrom
chore/llm-usage-says-which-call

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

A 270-token document costs about 31,000 tokens to process, and the server log could not say on what: each llm usage line carried the model and two numbers. The typed bench attributes them to phases by time window, and inside alignment the two votes, rule proposals and readings run interleaved.

Each line now carries call, the first sentence of the call's system message (truncated to 60 characters, spaces as underscores). System messages are constants and differ per kind of call, so no caller changes. The field comes last in the line; scripts that read model=… prompt=… completion=… still match.

usageByCall in scripts/bench/lib.mjs groups a log by it; typed.mjs prints the breakdown per kind of call and per document and stores it in the result.

No behaviour change. This is the first step of bringing the cost per document down: measure by kind of call, then cut.

🤖 Generated with Claude Code

WaylandYang and others added 2 commits September 28, 2026 16:45
A document of 270 tokens costs 31,000 to process and the log could not
say on what: each `llm usage` line had the model and two numbers, and the
typed bench attributed them to phases by time window, where votes, rule
proposals and readings run interleaved. Each line now carries `call`, the
first sentence of the call's system message: those are constants and
differ per kind of call, so no caller changes. The field comes last, the
scripts that read `model=… prompt=… completion=…` still match.

`usageByCall` in the bench library groups a log by it, and the typed
bench prints the breakdown per kind of call and per document.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Wayland Yang <wayland0916@gmail.com>
@WaylandYang
WaylandYang merged commit e041835 into dev Sep 28, 2026
@WaylandYang
WaylandYang deleted the chore/llm-usage-says-which-call branch September 28, 2026 08:54
WaylandYang added a commit that referenced this pull request Sep 28, 2026
* A document that states no date is not asked for one

0064 decision 1 says the separate call that read a date off the opening
goes away. Cut 2 kept it as a fallback for documents where extraction
reported no entry. With usage labelled by call (#996), twenty Re-DocRED
documents: sixteen took the fallback, each asking the question extraction
had just answered with "none" and getting the same answer, about 940
tokens a document. On the time bench every document that states a date
had it reported by extraction; the fallback never found one that was
missed.

The resolver no longer calls the model for the document's date. A
document whose extraction reported none has none: a relative expression
in it waits at grade C and its statements carry no attestation. A date
stored by the old call on a document extracted before cut 2 is still
read.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Wayland Yang <wayland0916@gmail.com>

* The record names the pull request

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Wayland Yang <wayland0916@gmail.com>

---------

Signed-off-by: Wayland Yang <wayland0916@gmail.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant