Appendix D Stack-Edu

本文为论文《SmolLM2:紧凑高效的小语言模型家族》「论文原文」板块的对应章节,按 arXiv 官方全文逐字保留,层级与「中文全文翻译」板块一一对应。

D.1 Annotation Prompt

We used the following prompt template to generate the 5-scale annotations for Stack-Edu (Python in this case) using the Llama3 model:

Below is an extract from a Python program. Evaluate whether it has a high educational value and could help teach coding. Use the additive 5-point scoring system described below. Points are accumulated based on the satisfaction of each criterion:

  • Add 1 point if the program contains valid Python code, even if it’s not educational, like boilerplate code, configs, and niche concepts.

  • Add another point if the program addresses practical concepts, even if it lacks comments.

  • Award a third point if the program is suitable for educational use and introduces key concepts in programming, even if the topic is advanced (e.g., deep learning). The code should be well-structured and contain some comments.

  • Give a fourth point if the program is self-contained and highly relevant to teaching programming. It should be similar to a school exercise, a tutorial, or a Python course section.

  • Grant a fifth point if the program is outstanding in its educational value and is perfectly suited for teaching programming. It should be well-written, easy to understand, and contain step-by-step explanations and comments.

The extract: <EXAMPLE>

After examining the extract:

  • Briefly justify your total score, up to 100 words.

  • Conclude with the score using the format: "Educational score: <total points>

We use similar prompts for the other 14 programming languages in Stack-Edu, adjusting the examples in the third criterion to reflect language-specific topics. For instance, in the JavaScript prompt, we replace "deep learning" with "asynchronous programming".

D.2 Stack-Edu language statistics

Table 7 shows the size of each programming language in Stack-Edu before and after the educational filtering. Initially, we also included HTML, but the classifier performed poorly, so we retained StarCoder2Data.

Table 7: Stack-Edu dataset statistics across programming languages. The table shows the original dataset size (from StarCoder2Data) and filtered Stack-Edu size for each programming language.