SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2409.13183 · 2024

$\textit{SKIntern}$: Internalizing Symbolic Knowledge for Distilling Better CoT Capabilities into Small Language Models

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 3 failures of our instrument; 1 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2409.13183.json · badge: /api/ran/2409.13183.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
xnhyacinth/skintern canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
FunctionStatusWhere it lives
create_score_evaluation_response Ran
ran on a synthesized input
xnhyacinth/skintern/src/llamafactory/api/chat.py
code served (permissive licence) · get_code("3f5cda900eb73d2b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned coroutine. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from typing import List, Optional
from dataclasses import dataclass

torch.manual_seed(0)

@dataclass
class ScoreEvaluationRequest:
    messages: List[str]
    model: str
    max_length: int = 512

@dataclass
class ScoreEvaluationResponse:
    model: str
    scores: List[float]

class ChatModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    async def aget_scores(self, messages: List[str], max_length: int) -> List[float]:
        # Simulate scoring based on message count
        scores = [0.75 + i * 0.1 for i in range(len(messages))]
        return scores

# Create instances
request = ScoreEvaluationRequest(
    messages=["Hello, how are you?", "Tell me a story."],
    model="gpt-4",
    max_length=256
)

chat_model = ChatModel()

ARGS = {
    "request": request,
    "chat_model": chat_model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
dictify Ran
ran; our contract draft was wrong, not the code
xnhyacinth/skintern/src/llamafactory/api/common.py
code served (permissive licence) · get_code("87aa9acaa81294f5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from pydantic import BaseModel

class SampleModel(BaseModel):
    name: str
    value: int
    data: list

# Create a valid Pydantic BaseModel instance
sample_data = SampleModel(name="test", value=42, data=[1, 2, 3])

ARGS = {
    "data": sample_data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pydantic, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
eval_csqa Ran
ran; our contract draft was wrong, not the code
xnhyacinth/skintern/src/llamafactory/eval/eval_bbh.py
code served (permissive licence) · get_code("a46f2292d2a56f74")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from transformers import StoppingCriteria, GenerationConfig

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self):
        self.eos_token_id = 2
        self.pad_token_id = 0
        self.padding_side = 'right'
    
    def convert_tokens_to_ids(self, token):
        return 3
    
    def batch_decode(self, token_ids, skip_special_tokens=False):
        # Return simple string representations
        return [f"decoded_sequence_{i}" for i in range(token_ids.shape[0])]

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def generate(self, input_ids, eos_token_id=None, stopping_criteria=None, **kwargs):
        # Return generated sequences of shape (batch_size, seq_length)
        batch_size = input_ids.shape[0]
        # Generate slightly longer sequences than input
        output_length = input_ids.shape[1] + 3
        return torch.randint(0, 10, (batch_size, output_length))

class MockGenerationArgs:
    def __init__(self):
        self.do_sample = False
        self.temperature = 1.0
        self.top_p = 0.9
        self.max_length = 20
        self.max_new_tokens = 10
        self.repetition_penalty = 1.0
        self.num_beams = 1
        self.length_penalty = 1.0

model = MockModel()
tokenizer = MockTokenizer()
batch_input = {
    'input_ids': torch.randint(0, 10, (2, 5)),
}
generation_args = MockGenerationArgs()

ARGS = {
    'model': model,
    'tokenizer': tokenizer,
    'batch_input': batch_input,
    'generation_args': generation_args,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
eval_triviaqa Ran
ran, honoured the contract we drafted
xnhyacinth/skintern/src/llamafactory/eval/eval_triviaqa.py
code served (permissive licence) · get_code("96d50158e2109ae3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import numpy as np
from collections import Counter

torch.manual_seed(0)

# Mock tokenizer
class MockTokenizer:
    def __init__(self):
        self.padding_side = 'left'
        self.eos_token_id = 2
        self.pad_token_id = 0
    
    def apply_chat_template(self, messages, tokenize=False, add_generation_prompt=False):
        return messages[0]['content']
    
    def convert_tokens_to_ids(self, token):
        if token == '<|eot_id|>':
            return 3
        return 1

# Mock model
class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 8)
    
    def forward(self, input_ids, attention_mask=None):
        return torch.randn(2, 10, 8)
    
    def generate(self, **kwargs):
        return torch.randint(0, 100, (2, 30))

# Mock generate_completions function (inject into the module)
def generate_completions(model, tokenizer, prompts, max_new_tokens, batch_size, do_sample, stop_id_sequences):
    return ["answer one", "answer two"]

# Inject the mock function into the module
import sys
current_module = sys.modules[__name__]
current_module.generate_completions = generate_completions

# Create dataset
dataset = [
    {
        'question': 'What is the capital of France?',
        'answers': ['Paris'],
        'subject': 'France'
    },
    {
        'question': 'What is the capital of Germany?',
        'answers': ['Berlin'],
        'subject': 'Germany'
    }
]

# Build arguments
ARGS = {
    'model': MockModel(),
    'tokenizer': MockTokenizer(),
    'dataset': dataset,
    'batch_size': 2,
    'output_result_dir': None,
    'use_prompt': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
jsonify Ran
ran; our contract draft was wrong, not the code
xnhyacinth/skintern/src/llamafactory/api/common.py
code served (permissive licence) · get_code("57583cf880d95444")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
from pydantic import BaseModel

class SampleModel(BaseModel):
    name: str
    value: int
    description: str = "default"

# Create an instance with some fields set
data_instance = SampleModel(name="test", value=42)

ARGS = {
    "data": data_instance
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pydantic — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
eval_csqa_chat Not yet run
unverified (harvested, no recorded run)
xnhyacinth/skintern/src/llamafactory/eval/eval_bbh.py
code served (permissive licence) · get_code("3fe26ff9ae58c1cf")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 3 the same month, 3 later) and 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
jsonify 28 other papers
4 dated earlier, 1 the same month, 23 later
2403.13372 (2024-03)
LLAMAFACTORY: Unified Efficient Fine-Tuning of 100+ Language Models
2405.04760 (2024-05)
Large Language Models for Cyber Security: A Systematic Literature Review
2406.04496 (2024-06)
Time Sensitive Knowledge Editing through Efficient Finetuning
and 25 more not named here
dictify 14 other papers
2 dated earlier, 1 the same month, 11 later
2403.13372 (2024-03)
LLAMAFACTORY: Unified Efficient Fine-Tuning of 100+ Language Models
2407.08044 (2024-07)
RoLoRA: Fine-tuning Rotated Outlier-free LLMs for Effective Weight-Activation Quantization
2409.13203 (2024-09)
Neural-Symbolic Collaborative Distillation: Advancing Small Language Models for Complex Reasoning Tasks
and 11 more not named here
create_score_evaluation_response 5 other papers
1 dated earlier, 1 the same month, 3 later
2407.08044 (2024-07)
RoLoRA: Fine-tuning Rotated Outlier-free LLMs for Effective Weight-Activation Quantization
2409.13203 (2024-09)
Neural-Symbolic Collaborative Distillation: Advancing Small Language Models for Complex Reasoning Tasks
2410.08081 (2024-10)
Packing Analysis: Packing Is More Appropriate for Large Models or Datasets in Supervised Fine-tuning
and 2 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Small Language Models (SLMs) are attracting attention due to the high computational demands and privacy concerns of Large Language Models (LLMs). Some studies fine-tune SLMs using Chains of Thought (CoT) data distilled from LLMs, aiming to enhance their reasoning ability. Furthermore, Some CoT distillation methods introduce external symbolic knowledge into the generation process to improve the limited knowledge memory, reasoning ability and out-of-domain (OOD) generalization of SLMs. However, the introduction of symbolic knowledge increases computational overhead and introduces potential noise. In this paper, we introduce $\textit{SKIntern}$, an innovative approach that empowers SLMs to internalize symbolic knowledge and few-shot examples gradually through a progressive fine-tuning process, guided by a predefined linear decay schedule under curriculum learning. By efficiently internalizing knowledge, $\textit{SKIntern}$ reduces computational overhead and speeds up the reasoning process by focusing solely on the question during inference. It outperforms state-of-the-art baselines by over 5\%, while reducing inference costs (measured in FLOPs) by up to $4\times$ across a wide range of SLMs in both in-domain (ID) and out-of-domain (OOD) tasks. Our code will be available at \url{https://github.com/Xnhyacinth/SKIntern}.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2409.13183")
get_code_for_paper("2409.13183")
have("2409.13183")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2409.13183.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2409.13183.svg)](https://syntology.ai/paper/2409.13183)

Connect an agent — have() is free.