Skip to content

fix(eval): compute novel F1 token overlap - #856

Merged
dosco merged 2 commits into
ax-llm:mainfrom
original4422:fix/novel-f1-token-overlap
Oct 18, 2026
Merged

dosco merged 2 commits into
ax-llm:mainfrom
original4422:fix/novel-f1-token-overlap

Conversation

@original4422

@original4422 original4422 commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor
  • What kind of change does this PR introduce?

    Bug fix for the exported novel F1 evaluation metric.

  • What is the current behavior?

    AxEvalUtil.novelF1ScoreOptimized leaves token overlap hardcoded to zero. Ordinary partial/identical/disjoint inputs produce NaN F1; recall is zero or NaN when the filtered truth is empty. For example, albatross narwhal versus albatross cobalt gives NaN/0 instead of F1/recall 0.5.

    Fixes Implement the exported novel F1 evaluation metric #805.

  • What is the new behavior (if this is a feature change)?

    Count multiset overlap after the existing stopword/history filtering and return finite F1 or recall. Repeated tokens contribute at most the minimum occurrence count. Two empty filtered inputs score 1 and a single empty input scores 0, matching the sibling F1 helper's empty-input convention. Empty normalized tokens are excluded, and local maps also handle tokens such as constructor safely.

    Shared normalization, token counting, exact match and ordinary F1 helpers are unchanged.

  • AxIR portable behavior check:

    This changes portable axgen behavior in exactly src/ax/dsp/eval.ts and src/ax/dsp/eval.test.ts. New open backlog entry axir-2026-10-18-novel-f1-token-overlap-and-finite-empty-input-scores is bound to this PR (fix(eval): compute novel F1 token overlap #856) and lists those exact two paths. Only the required ir/axir-backlog.json and rendered docs/AXIR_BACKLOG.md exception accompany the handwritten TypeScript. Existing entries/exemptions are unchanged; no AxIR or generated-language changes are included. npm run axir:backlog:validate passed. Hosted checks remain to be verified.

  • Other information:

    Regression uses the original public AxEvalUtil export. Before the fix: 16 failed, 1 passed. Final local validation (Node 26.10.0):

    • npm run test:unit --workspace=@ax-llm/ax -- dsp/eval.test.ts dsp/util.test.ts dsp/generate.metrics.test.ts --maxWorkers=2: 53 passed, 0 skipped.
    • npm run test:type-check --workspace=@ax-llm/ax: passed.
    • npm exec -- biome check src/ax/dsp/eval.ts src/ax/dsp/eval.test.ts: passed; actual pre-commit hook passed too.
    • Targeted cspell check: passed.

    Paid-provider and generated-language suites were not run; this metric is synchronous and needs no model or API key.

    AI assistance was used for investigation, implementation and validation. The original-package reproduction, regression results and cumulative diff were checked before submission.

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

External contribution policy

✅ This PR now complies with the external contribution policy.

@original4422

Copy link
Copy Markdown
Contributor Author

Hi @dosco, when convenient, could you please review the novel F1 overlap and empty-input fix? The 53 focused tests pass, and the required PR-linked AxIR backlog entry is included. Thank you.

@dosco
dosco merged commit 0876da8 into ax-llm:main Oct 18, 2026
16 checks passed
@dosco dosco mentioned this pull request Oct 18, 2026
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.

2 participants