4.2 KiB
ADR-0131.G.3 — Capability Axis: Numeric Literals (Money, Fractions, Compound Numbers)
Status
Accepted
Date
2026-05-23
Context
As part of the ADR-0131 re-benchmarking roadmap, the GSM8K coverage probe identifies capability axes along which the NL-to-typed-graph parser must be extended. This decision specifies the capability axis G.3: support for money, fractions, and compound numeric literals.
Historically, the parser was restricted to simple integer digits and single-word numbers (1 to 12). Real-world math problems introduce currency notation, fractional quantities (both digit slash forms and spelled equivalents), adjectives qualifying units, and hyphenated numeric nouns.
Decision
Extend the candidate-graph parser layer to consume the existing semantic packs en_units_v1 (ADR-0127) and en_numerics_v1 (ADR-0128) to recognize these literal shapes without hardcoding inline regex alternations.
1. Closed Literal Classes
We implement recognition for four distinct literal classes:
- Money: Recognizes currency symbols and currency word forms. Leading symbols map to canonical plural units via
en_units_v1. - Fractions: Recognizes digit slash forms (e.g.,
3/4) and spelled equivalents in the pack (e.g.,one-half,three-quarters). Fractions are converted to floats inQuantitystructures. Prepositionalof <substance>tails (e.g.3/4 of a cake) are parsed, using the substance as the unit where explicit unit tokens are absent. - Word-number compositions: Recognizes combinations of spelling numbers, adjectives, and head nouns (e.g.,
five full boxes of crayons). The adjective is correctly retained as part of the unit (full boxes of crayons≢boxes). - Hyphenated compound numerics: Recognizes compound adjectives modifying a unit head noun (e.g.,
10 one-hour videos).
2. Currency-Symbol → Unit Mapping
Leading currency symbols resolve deterministically to plural units in the unit pack:
$→"dollars"¢→"cents"€→"euros"£→"pounds"¥→"yens"₱→"pesos"
Currency symbols compose with rate denominators (e.g., $ and hour → "dollars per hour"; $0.75 each → "dollars per item").
3. Scope Pinning and Refusal Probes
To preserve the wrong == 0 firewall, inputs that exceed well-defined boundaries are cleanly refused:
- Decimals > 2 in currency:
$18.0000is refused at the parser layer. - Division by zero: Fractions like
1/0fail solver/graph construction and refuse. - Ambiguous hyphenations: Expressions like
one-hour-oldrefuse. - Out of scope notation: Percentages (
10%) and scientific notation (1e3) are excluded and refuse.
4. Deferred Shapes
The following shapes remain out of scope for G.3 and will be addressed in future capability iterations:
- Distributive operators: Distributive scopes (like "each saved up $40" or "each weighing 5 ounces") are deferred to G.4.
- Unit inheritance: Re-using the last referenced unit (e.g., "gives 1/4 of that") requires state threading and is deferred to P3 grammar integration.
- Multi-clause sentence syntax: Compound sentences linked by conjunctions (like
but then lost 12orand her friend has) are refused.
Verification Plan
- Curated Benchmarks: Author 25 isolated capability cases under
evals/math_capability_axes/G3_numerics/v1/cases.jsonl(5 per literal class, 5 refusal probes). - Runner Verification: The runner at
evals/math_capability_axes/G3_numerics/v1/runner.pymust scorecorrect_rate == 100%against expectations andwrong == 0. - Determinism: The runner output
report.jsonmust be byte-equal across consecutive runs. - Regression Testing: All test suites must remain green (
pytest tests/test_adr_0131_G3_numerics.pyandtests/test_adr_0131_*.py).
Consequences
- The G3 capability axis is fully verified and landed under the safety rail.
- Parsing of money, fractions, and compound noun phrases is now fully pack-driven and cached at start-up.
- The baseline GSM8K train-sample coverage probe shows that targeted first-sentence refusals (like
Tina makes $18.00 an hour) now successfully parse, moving the refusal frontier further down the problem structure.