Skip to content

Commit 32a275a

Browse files
committed
feat(julia): apply_domain_weights gains category-prefix rollup on exact-key miss
When a domain_hint like "arithmetic.natural_numbers" has no exact match in PROVER_DOMAIN_WEIGHTS, fall back to the mean of every key sharing the "arithmetic." prefix. This lets sparse domain training data still influence ranking through its category siblings, matching the rollup story that VeriSim's mv_prover_success_by_class is shaped to consume. The "no evidence → return scores unchanged" terminal behaviour and the [0.5, 1.0] modulation range are preserved. https://claude.ai/code/session_01YPqu7gti4azBach6ZvpRFJ
1 parent d5554ec commit 32a275a

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

src/julia/api/gnn_endpoint.jl

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,27 @@ function apply_domain_weights(scores::Vector{Float32}, domain_hints::Vector{Stri
159159
weights = PROVER_DOMAIN_WEIGHTS[]
160160
domain_rates = Float64[]
161161
for domain in domain_hints
162+
# First: collect exact-match rates across all provers.
163+
exact_matches = Float64[]
162164
for (_, prover_weights) in weights
163165
if haskey(prover_weights, domain)
164-
push!(domain_rates, prover_weights[domain])
166+
push!(exact_matches, prover_weights[domain])
167+
end
168+
end
169+
if !isempty(exact_matches)
170+
append!(domain_rates, exact_matches)
171+
continue
172+
end
173+
# Miss: fall back to mean of all keys sharing the same category prefix.
174+
parts = split(domain, '.'; limit=2)
175+
if length(parts) == 2
176+
prefix = parts[1] * "."
177+
for (_, prover_weights) in weights
178+
for (k, v) in prover_weights
179+
if startswith(k, prefix)
180+
push!(domain_rates, v)
181+
end
182+
end
165183
end
166184
end
167185
end

0 commit comments

Comments
 (0)