Phrase alignment batches signatures by their candidates, casts no second vote after a first that says none, and asks no rules of a bare head word by WaylandYang · Pull Request #999 · deeplethe/utopia · GitHub
Skip to content

Phrase alignment batches signatures by their candidates, casts no second vote after a first that says none, and asks no rules of a bare head word - #999

Merged
WaylandYang merged 4 commits into
devfrom
cost/batch-by-candidates
Sep 28, 2026
Merged

WaylandYang merged 4 commits into
devfrom
cost/batch-by-candidates

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

Phrase alignment was 38% of what a document costs (20 documents, claude-haiku-4-5). Three changes, none of which changes what a signature is shown.

What changes

  • Signatures are batched by their candidates. The property table is written once per batch and was nearly half of a call's input, because signatures batched in arrival order share almost no candidates. batch_by_candidates puts signatures whose candidates overlap in the same batch (greedy, deterministic). Each signature still sees exactly its own candidates.
  • A first vote that says none is not followed by a second. The second vote exists so that "pick the first candidate" cannot pass for agreement on a binding. When the first vote finds no property, no second answer can bind. The decision is none with votes.reason = "first_vote_none". A first vote that was not answered is not followed by a second either. Signatures asked only for marks still get two votes.
  • A kind word that is only a head word is not asked for rules. The object of a kind-word rule is read from the kind word itself ("british film" gives United Kingdom). Of 159 kind words asked in the baseline run 127 were a single word, and none of the 8 rules proposed for them ("state" implies country) has an object that can be read. Words with digits, hyphens or unsegmented scripts are still asked.

Measured

Two full runs differ in what extraction produces (229 and 210 signatures, 137 in common), so alignment was decided again on the same statements of one base, 210 signatures:

baseline baseline again batched batched again all three
calls 46 47 36 40 32
tokens 237,109 244,508 164,147 180,544 133,115
bound / none / undecided 53 / 110 / 47 66 / 108 / 36 69 / 108 / 33 67 / 109 / 34 63 / 119 / 28
typed facts 82 87 99 92 84
  • Batching saves about 30% of phrase alignment, the conditional second vote brings it to about 45%.
  • The model varies more than the change does: the same build on the same signatures at temperature 0 gives identical decisions for 163 to 166 of 210; baseline against batched is 146 to 159.
  • The cost of the conditional second vote: of the 98 signatures it records as none, 8 to 12 were undecided in the other runs and no longer reach a person's queue.
  • Full 20-document run with batching only: 41,074 to 31,309 tokens per document, judged precision 79.3% and 78.8%.

Details in scripts/bench/README.md.

🤖 Generated with Claude Code

WaylandYang and others added 4 commits September 28, 2026 17:42
Signed-off-by: Wayland Yang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Wayland Yang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Wayland Yang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Wayland Yang <wayland0916@gmail.com>
@WaylandYang
WaylandYang merged commit 7d73ff9 into dev Sep 28, 2026
@WaylandYang
WaylandYang deleted the cost/batch-by-candidates branch September 28, 2026 10:47
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