Views
No views yet
A reasoning chunk is useful if it makes the correct future solution more likely.restatement -> weak exploration -> wrong idea -> self-correction -> key insight -> correct continuationcorrect setup -> generic ramble -> algebra mistake -> wrong conclusionSince x > 0, the sign depends on x^2 - a.Use the bipartition invariant.Let d = ab/(a+b), so (a-d)(b-d)=d^2.1P = original problem prompt
2R = current reasoning prefix
3C = candidate reasoning chunk
4T = target future text
5M = scoring modelT can be one of several forms:11. Final answer only
22. Short key solution step
33. Reference solution prefix
44. Full reference solution
55. Verifier-approved answer explanation
66. Gold notes containing key facts and final answerkeypoint + compact derivation + final answer1Since x > 0, f'(x) = (x^2-a)/x, so the sign depends on x^2-a.
2For f(x) >= 0 on [1,infty), all a < 0 work and for a > 0 we need a <= 1.
3Answer: a in (-infty,0) union (0,1].Does adding candidate chunk C after prefix R increase log probability of target T?1base_score = logprob_M(T | P + R)
2after_score = logprob_M(T | P + R + C)
3delta = after_score - base_score1delta > 0 -> C made the target more likely
2delta = 0 -> C had little effect
3delta < 0 -> C made the target less likely1Given f(x)=1/2 x^2 - a ln x - 1/2, find monotonicity and the range of a
2such that f(x)>=0 for x in [1,infty).We have f'(x)=x-a/x.Since x>0, f'(x)=(x^2-a)/x, so the sign depends on x^2-a.Multiplying by x^2 gives x^3-a, so the sign depends on x^3-a.1Algorithm 1: Basic FLAIR Candidate Ranking
2
3Input:
4 problem prompt P
5 reasoning prefix R
6 candidate chunks C_1 ... C_n
7 target text T
8 scoring model M
9
10Step 1:
11 Compute base_score:
12 base_score = logprob_M(T | P + R)
13
14Step 2:
15 For each candidate chunk C_i:
16 after_score_i = logprob_M(T | P + R + C_i)
17 delta_i = after_score_i - base_score
18
19Step 3:
20 Rank candidates by delta_i.
21
22Output:
23 best_chunk = candidate with highest delta
24 worst_chunk = candidate with lowest delta
25 all scored candidates1def flair_rank(model, prompt, prefix, chunks, target):
2 base_score = logprob(model, context=prompt + prefix, target=target)
3
4 scored = []
5 for chunk in chunks:
6 after_score = logprob(model, context=prompt + prefix + chunk, target=target)
7 delta = after_score - base_score
8 scored.append({
9 "chunk": chunk,
10 "base_score": base_score,
11 "after_score": after_score,
12 "delta": delta,
13 })
14
15 scored.sort(key=lambda x: x["delta"], reverse=True)
16 return scored1{
2 "problem": "...",
3 "prefix": "...",
4 "chunk": "...",
5 "base_score": -0.3006,
6 "after_score": -0.2801,
7 "delta": 0.0205,
8 "target_token_count": 589
9}1chosen = highest-delta chunk
2rejected = lowest-delta chunk11. chosen_delta must be greater than a positive threshold
22. rejected_delta should be negative or clearly lower than chosen_delta
33. chosen - rejected margin should be large enough
44. chosen chunk should not be pure filler
55. rejected chunk should not contain a correct key step that is only followed by later drift1Algorithm 2: FLAIR Pair Builder
2
3Input:
4 scored chunks from Algorithm 1
5 positive threshold tau_pos
6 margin threshold tau_margin
7
8Step 1:
9 chosen = chunk with maximum delta
10 rejected = chunk with minimum delta
11
12Step 2:
13 Check:
14 chosen.delta > tau_pos
15 chosen.delta - rejected.delta > tau_margin
16
17Step 3:
18 If checks pass:
19 emit preference pair
20
21Output:
22 preference pair:
23 prompt = P + R
24 chosen = chosen.chunk
25 rejected = rejected.chunk1def build_flair_pair(scored, tau_pos=0.0, tau_margin=0.01):
2 scored = sorted(scored, key=lambda x: x["delta"], reverse=True)
3
4 chosen = scored[0]
5 rejected = scored[-1]
6
7 if chosen["delta"] <= tau_pos:
8 return None
9
10 if chosen["delta"] - rejected["delta"] <= tau_margin:
11 return None
12
13 return {
14 "chosen": chosen["chunk"],
15 "rejected": rejected["chunk"],
16 "chosen_delta": chosen["delta"],
17 "rejected_delta": rejected["delta"],
18 "margin": chosen["delta"] - rejected["delta"],
19 }1{
2 "prompt": "Problem + current reasoning prefix",
3 "chosen": "Since x>0, f'(x)=(x^2-a)/x...",
4 "rejected": "Multiplying by x^2 gives x^3-a..."
5}1tokens 0-128: generic restatement
2tokens 128-256: wrong approach
3tokens 256-384: self-correction
4tokens 384-512: correct key insight1rollout length = 512 tokens
2block size = 64 tokens
3stride = 64 tokens
4training span = 128 to 192 tokens1score_before_block = logprob(T | P + R + rollout before block)
2score_after_block = logprob(T | P + R + rollout through block)
3block_delta = score_after_block - score_before_block1Algorithm 3: Block-Level FLAIR
2
3Input:
4 prompt P
5 prefix R
6 rollout W
7 target T
8 block size B
9
10Step 1:
11 Split rollout W into blocks:
12 W_1, W_2, ..., W_k
13
14Step 2:
15 For each block W_i:
16 context_before = P + R + W_1 + ... + W_{i-1}
17 context_after = P + R + W_1 + ... + W_i
18
19 before_score = logprob(T | context_before)
20 after_score = logprob(T | context_after)
21 block_delta = after_score - before_score
22
23Step 3:
24 Select:
25 best_block = block with highest block_delta
26 worst_block = block with lowest block_delta
27
28Output:
29 block-level credit map1def block_flair(model, prompt, prefix, rollout_blocks, target):
2 results = []
3 previous_context = prompt + prefix
4
5 before_score = logprob(model, previous_context, target)
6
7 for idx, block in enumerate(rollout_blocks):
8 after_context = previous_context + block
9 after_score = logprob(model, after_context, target)
10
11 delta = after_score - before_score
12
13 results.append({
14 "block_id": idx,
15 "block": block,
16 "before_score": before_score,
17 "after_score": after_score,
18 "delta": delta,
19 })
20
21 previous_context = after_context
22 before_score = after_score
23
24 return results1GRWO = generate candidate paths
2FLAIR = score which path helps
3DPO/RL = train on selected path1Algorithm 4: GRWO-Assisted FLAIR Data Generation
2
3Input:
4 problem P
5 private solution guide G
6 base model M
7 scoring model S
8
9Step 1:
10 Generate a reasoning prefix R from P.
11
12Step 2:
13 Generate candidate windows:
14 C_unguided = model continuation without guide
15 C_guided = model continuation using private guide
16 C_repaired = continuation after correcting a bad path
17 C_negative = intentionally weak or unguided continuation
18
19Step 3:
20 Score every candidate with FLAIR:
21 delta_i = logprob(T | P + R + C_i) - logprob(T | P + R)
22
23Step 4:
24 Select:
25 chosen = high-delta candidate/span
26 rejected = low-delta candidate/span
27
28Step 5:
29 Emit training pair.1def grwo_flair_sample(generator, scorer, problem, guide, target):
2 prefix = generator.generate_prefix(problem)
3
4 candidates = []
5
6 candidates.append(generator.generate(problem, prefix, guide=None))
7 candidates.append(generator.generate(problem, prefix, guide=guide))
8 candidates.append(generator.generate_repair(problem, prefix, guide=guide))
9 candidates.append(generator.generate_negative(problem, prefix))
10
11 scored = flair_rank(
12 model=scorer,
13 prompt=problem,
14 prefix=prefix,
15 chunks=candidates,
16 target=target,
17 )
18
19 pair = build_flair_pair(scored)
20 return pairprefix -> guided continuation -> DPO updateDoes this guided continuation increase probability of the correct target?1candidate_count = 4 to 8
2prefix_tokens = 32 to 96
3candidate_tokens = 256 to 512
4block_size = 64
5training_span_tokens = 128 to 192
6temperature = 0.7 for exploration, 0.0 for deterministic validation1generate long enough to reveal trajectory
2train only the span with useful credit1chosen = high future-likelihood chunk
2rejected = low future-likelihood chunk1increase log probability of chosen over rejected
2relative to a reference modelweight = 1.0 + clipped_positive_block_deltareward = final_answer_reward + alpha * flair_delta1final_answer_reward = 1 if answer correct else 0
2flair_delta = logprob target after rollout - logprob target before rolloutadvantage_i = (reward_i - mean_reward) / (std_reward + eps)selected_span = span around highest positive block_deltaA very long reference solution with lots of style-specific wording.1A compact target containing:
21. the key mathematical move
32. the main derivation
43. the final answerAnswer: 120cheap, directweak for long reasoning, may miss useful intermediate steps1Key step: treat EE and SS as blocks.
2Answer: 5! = 120.strong signal for reasoning moverequires keypoint extraction1Use Lagrange multipliers or generalized eigenvalue method.
2The maximum occurs at the largest generalized eigenvalue times 22.
3Final answer: ...more robust than final answer onlymore expensive to prepare1target_1 = key step
2target_2 = compact derivation
3target_3 = final answerflair_score = average(delta over targets)11. Average delta for known good chunks
22. Average delta for known bad chunks
33. Good-vs-bad separation
44. Spearman correlation between label and delta
55. Best good chunk > best bad chunk rate
66. Every good chunk > every bad chunk rate
77. Final answer accuracy after training
88. Keypoint hit rate
99. Wrong-pivot frequency
1010. Repetition rate1Average delta_logprob, good chunks: 1.0155
2Average delta_logprob, bad chunks: -0.4783
3Average delta_margin, good chunks: 1.3726
4Average delta_margin, bad chunks: -0.8954
5Best good > best bad by margin: 80.0%
6Spearman(label, delta_margin): 0.73111delta should be positive
2target logprob should improve
3correct keypoint should become easier to generate1delta should be negative
2wrong continuation should become more likely
3correct target should become less likely1good and bad chunks have similar delta
2generic phrases score too highly
3long reference targets dominate the score
4answer-only target gives unstable signal
5negative chunks contain correct setup
6positive chunks contain hidden algebra mistakes1use compact keypoint targets
2use multiple target phrasings
3use final answer verification1score multiple future targets
2include keypoint and answer targets
3evaluate with actual generation after the chunk1score blocks instead of tokens
2use 64-token block checkpoints
3cache prefix KV states when possible
4score only top candidate windows1use block-level FLAIR
2train 128-192 token spans
3filter obvious invalid math1combine FLAIR with final answer reward
2use symbolic verifiers where possible
3track benchmark accuracy separately1FLAIR_CONFIG = {
2 "candidate_count": 8,
3 "prefix_tokens": 64,
4 "rollout_tokens": 512,
5 "block_size": 64,
6 "training_span_tokens": 192,
7 "target_mode": "keypoint_plus_answer",
8 "score_mode": "avg_logprob",
9 "pair_margin_threshold": 0.01,
10 "positive_delta_threshold": 0.0,
11}1FLAIR_CONFIG_CHEAP = {
2 "candidate_count": 4,
3 "prefix_tokens": 48,
4 "rollout_tokens": 256,
5 "block_size": 64,
6 "training_span_tokens": 128,
7}1FLAIR_CONFIG_STRONG = {
2 "candidate_count": 16,
3 "prefix_tokens": 64,
4 "rollout_tokens": 512,
5 "block_size": 32,
6 "training_span_tokens": 192,
7 "multi_target_scoring": True,
8}1generate 512 tokens
2score by 64-token blocks
3select 128-192 token high-impact span
4pair with low-impact or harmful span
5train with DPO or weighted DPO11. better key-step selection
22. fewer wrong early branches
33. stronger self-correction
44. less useless restatement
55. better handling of invariants
66. better derivative sign analysis
77. better parameter range reasoning
88. better ability to recover from weak startsThe model becomes better at finding the decisive next reasoning move.1[ ] Load scoring model
2[ ] Prepare prompt P
3[ ] Prepare prefix R
4[ ] Generate candidate chunks C_i
5[ ] Prepare target T
6[ ] Compute base target logprob
7[ ] Compute after target logprob for each candidate
8[ ] Compute delta for each candidate
9[ ] Rank candidates by delta
10[ ] Build chosen/rejected pairs
11[ ] Train or filter dataset
12[ ] Evaluate correlation with correctness1[ ] using full reference only as target
2[ ] training whole 512-token rollout without block scoring
3[ ] ignoring negative chunks that contain useful setup
4[ ] using too many noisy samples without margin filtering
5[ ] assuming positive delta always means mathematically correctReward reasoning chunks that make the correct future solution more likely.delta = logprob(target | prefix + chunk) - logprob(target | prefix)11. rank candidate reasoning chunks
22. filter reasoning data
33. build chosen/rejected pairs
44. select training spans
55. improve GRWO sample quality
66. provide reward signals for RL-style training1Generate long enough to see the path.
2Score the future impact.
3Train only the span that caused the improvement.1- compact keypoint targets
2- final answer verification
3- block-level scoring
4- GRWO candidate generation
5- margin filtering
6- careful diagnostics