File size: 1,051 Bytes
d13981b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from eval.output_behavior import summarize_output_behavior_counts


def test_summarize_output_behavior_counts_separates_reasoning_pathologies():
    counts = summarize_output_behavior_counts(
        [
            "Goal: Find max.\nObservation: 2 and 5.\nReasoning: 5 is larger.\nConclusion: max is 5.\nAnswer: 5",
            "Goal: Compare.\nObservation: inspect bars\nReasoning: calculate",
            "Goal:\nObservation.\nReasoning,\nConclusion,\nAnswer:.50 .",
            "Answer: 7",
        ]
    )

    assert counts == {
        "total": 4,
        "full_cot_template": 2,
        "partial_cot_template": 1,
        "goal_without_answer": 1,
        "empty_cot_skeleton": 1,
        "malformed_answer_section": 1,
    }


def test_summarize_output_behavior_counts_handles_empty_input():
    assert summarize_output_behavior_counts([]) == {
        "total": 0,
        "full_cot_template": 0,
        "partial_cot_template": 0,
        "goal_without_answer": 0,
        "empty_cot_skeleton": 0,
        "malformed_answer_section": 0,
    }