File size: 4,307 Bytes
6b26786
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3528f8c
6b26786
 
 
3528f8c
 
 
6b26786
 
 
 
 
 
 
 
 
 
3528f8c
 
 
6b26786
 
 
 
 
 
 
 
 
 
3528f8c
 
 
6b26786
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
operators: 
- id: load_math
  config:
    type: hf_source
    dataset: open-web-math/open-web-math
    split: train
    trust_remote_code: True
- id: sample_dataset
  config:
    type: function
    function: data_strategies.commons.uniform_sample_fixed
    function_config:
      num_samples: 50_000  # 1.25% of 10000 target from stage 1
  input_ids:
  - load_math
- id: generate_instructions
  config:
    type: completions
    map: chat
    map_config:
      system_message: "You are a helpful assistant."
      user_message: |
        You are to reform the following math text snippet into a question with a quantitative or verifiable answer such as one that would be 
        included in the USAMO or the Putnam Exam. 

        Text: {{text}}
        
        Include only the new question or task. Do not include anything like "Here is the instruction". You can either extract a 
        question from the text or form a new one based on the text. Make the question sound like what a human would ask a language model. 
      output_column: instruction_seed
    model: gpt-4o-mini
    temperature: 1.0
    require_all_responses: False
    batch: True
  input_ids:
    - sample_dataset
- id: add_constant_column
  config:
    type: function
    function: data_strategies.commons.add_constant_columns
    function_config:
      response_seed: ""
  input_ids:
  - generate_instructions
- id: drop_columns
  config:
    type: function
    function: data_strategies.commons.keep_only_columns
    function_config:
      columns_to_keep:
      - instruction_seed
      - response_seed
  input_ids:
  - add_constant_column
- id: decontaminate
  config:
    type: cpu_function
    sharded: false
    num_cpus: 32
    function:  data_strategies._A1_Source.utils.decontaminate_fuzzy_w_ngram
    function_config:
      column: instruction_seed
      eval_datasets:
        - HuggingFaceH4/MATH-500
        - Maxwell-Jia/AIME_2024
        - AI-MO/aimo-validation-amc
        - livecodebench/code_generation_lite
        - mlfoundations-dev/AIME2025_combined
        - cais/hle
        - open-r1/codeforces
        - Idavidrein/gpqa
        - daman1209arora/jeebench
        - mlfoundations-dev/mmlu_pro_eval_full
        - Qwen/CodeElo
        - open-r1/ioi
      eval_columns:
        - problem
        - Problem
        - problem
        - question_content
        - question
        - question
        - description
        - Question
        - question
        - prompt
        - description
        - statement
      eval_splits:
        - test
        - train
        - train
        - test
        - train
        - test
        - test
        - train
        - test
        - test
        - test
        - test
      eval_subsets:
        Idavidrein/gpqa: gpqa_diamond
      similarity_threshold: 80.0
      ngram_size: 13
  input_ids:
  - drop_columns
- id: sample_dataset_final
  config:
    type: function
    function: data_strategies.commons.uniform_sample_fixed
    function_config:
      num_samples: 31_600  # 1.25% of 10000 target from stage 1
  input_ids:
  - decontaminate

# - id: annotate_r1
#   config:
#     type: completions
#     map: deepseek_reasoner
#     map_config:
#       input_problem_column: instruction_seed
#     model: deepseek-reasoner
#     batch: false
#     temperature: 1.0
#     require_all_responses: false
#     backend: openai
#     backend_params:
#       max_requests_per_minute: 500
#       max_tokens_per_minute: 1_000_000_000
#       base_url: "https://api.deepseek.com/"
#       invalid_finish_reasons: ['content_filter']
#   input_ids:
#     - sample_dataset_final
# - id: convert_reasoning_trace_to_final
#   config:
#     type: function
#     function: data_strategies.commons.convert_reasoning_trace_to_final
#     function_config:
#       reasoning_column: reasoning
#       solution_column: deepseek_solution
#       output_column: final_reasoning_trace
#   input_ids:
#   - annotate_r1
# - id: convert_to_sharegpt
#   config:
#     type: function
#     function: data_strategies.commons.convert_instruction_response_to_sharegpt
#     function_config:
#       input_instruction_column: instruction_seed
#       input_response_column: final_reasoning_trace
#       output_sharegpt_column: conversations
#   input_ids:
#     - convert_reasoning_trace_to_final