SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2312.15685 · 2023

What Makes Good Data for Alignment? A Comprehensive Study of Automatic Data Selection in Instruction Tuning

arXiv · PDF · Open in the Atlas

Code that ran

4 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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2312.15685.json · badge: /api/ran/2312.15685.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
hkust-nlp/deita canonical (classifier label)
classifier basis: census
4 ran · 2 no recorded run
FunctionStatusWhere it lives
get_datasets Ran
ran; our contract draft was wrong, not the code
hkust-nlp/deita/src/deita/alignment/train_scorers.py
code served (permissive licence) · get_code("e0e89efde423abfd")
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 Dataset. 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 numpy as np
from datasets import Dataset

torch.manual_seed(0)

# Create sample data with conversations
data = [
    {
        'conversations': [
            {'role': 'user', 'content': 'Hello'},
            {'role': 'assistant', 'content': 'Hi there'}
        ]
    },
    {
        'conversations': [
            {'role': 'user', 'content': 'How are you?'},
            {'role': 'assistant', 'content': 'I am doing well'}
        ]
    }
]

# Create a simple preprocess function that tokenizes conversations
def preprocess_func(example):
    conversations = example['conversations']
    # Simulate tokenization by converting to token ids
    text = ' '.join([f"{turn['role']}: {turn['content']}" for turn in conversations])
    token_ids = [ord(c) % 100 for c in text]  # Simple tokenization
    attention_mask = [1] * len(token_ids)
    return {
        'input_ids': token_ids[:512],
        'attention_mask': attention_mask[:512]
    }

ARGS = {
    'data': data,
    'preprocess_func': preprocess_func,
    'num_proc': 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Dataset — a Dataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Dataset output the recorded ndim 1 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
init_to_zero Ran
ran; our contract draft was wrong, not the code
hkust-nlp/deita/src/deita/alignment/flash_attn/triton_flash_attention.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from amazon-science/dualkv-flash-attn-for-rl, is pointer only (licence: NOASSERTION) · get_code("1586b639a5abd0b0")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from amazon-science/dualkv-flash-attn-for-rl, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

load_data Ran
ran; our contract draft was wrong, not the code
hkust-nlp/deita/src/deita/pipeline/utils.py
code served (permissive licence) · get_code("72a2c6730ba70309")
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 json
import tempfile
import os

# Create a temporary JSON file with valid data
temp_dir = tempfile.mkdtemp()
json_file_path = os.path.join(temp_dir, "test_data.json")

# Write test data as JSON objects (one per line for the fallback case)
with open(json_file_path, 'w') as f:
    json.dump({"key1": "value1", "key2": 42}, f)

# Create a mock self object since this is a method
class MockSelf:
    pass

ARGS = {
    "self": MockSelf(),
    "data_path": json_file_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
sort_key_split Ran
ran; our contract draft was wrong, not the code
hkust-nlp/deita/src/deita/pipeline/utils.py
code served (permissive licence) · get_code("56fc0e03de7a4b1c")
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

def sort_key_split(sort_key: str) -> list:
    """
    Split sort_key into a list of sort keys.
    
    sort_key: str - sort key to split.
    """
    if ',' in sort_key:
        return sort_key.split(',')
    elif '.' in sort_key:
        return sort_key.split('.')
    elif '+' in sort_key:
        return sort_key.split('+')
    else:
        raise ValueError("sort_key must be a string with delimiter ',' or '.' or '+'.")


ARGS = {
    'sort_key': 'key1,key2,key3'
}
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 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
forward Not yet run
unverified (harvested, no recorded run)
hkust-nlp/deita/src/deita/alignment/flash_attn/bloom_flash_attention.py
code served (permissive licence) · get_code("167711db8b432976")
How it ran

no invocation recorded.

get_conv_template Not yet run
unverified (harvested, no recorded run)
hkust-nlp/deita/src/deita/alignment/conversation.py
code served (permissive licence) · get_code("1c12e90632ed637e")
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, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 1 the same month, 2 later) and 4 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
get_conv_template 69 other papers
11 dated earlier, 2 the same month, 55 later, 1 undated
1911.03705 (2019-11)
CommonGen: A Constrained Text Generation Challenge for Generative Commonsense Reasoning
2112.05682 (2021-12)
Self-attention Does Not Need $O(n^2)$ Memory
2204.07705 (2022-04)
SUPER-NATURALINSTRUCTIONS: Generalization via Declarative Instructions on 1600+ NLP Tasks
and 66 more not named here
init_to_zero 12 other papers
3 dated earlier, 9 later
2304.11277 (2023-04)
PyTorch FSDP: Experiences on Scaling Fully Sharded Data Parallel
2309.06180 (2023-09)
Efficient Memory Management for Large Language Model Serving with PagedAttention
2310.05869 (2023-10)
HyperAttention: Long-context Attention in Near-Linear Time
and 9 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-23.

Repositories linked to this paper

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

Abstract

Instruction tuning is a standard technique employed to align large language models to end tasks and user preferences after the initial pretraining phase. Recent research indicates the critical role of data engineering in instruction tuning -- when appropriately selected, only limited data is necessary to achieve superior performance. However, we still lack a principled understanding of what makes good instruction tuning data for alignment, and how we should select data automatically and effectively. In this work, we delve deeply into automatic data selection strategies for alignment. We start with controlled studies to measure data across three dimensions: complexity, quality, and diversity, along which we examine existing methods and introduce novel techniques for enhanced data measurement. Subsequently, we propose a simple strategy to select data samples based on the measurement. We present deita (short for Data-Efficient Instruction Tuning for Alignment), a series of models fine-tuned from LLaMA and Mistral models using data samples automatically selected with our proposed approach. Empirically, deita performs better or on par with the state-of-the-art open-source alignment models with only 6K SFT training data samples -- over 10x less than the data used in the baselines. When further trained with direct preference optimization (DPO), deita-Mistral-7B + DPO trained with 6K SFT and 10K DPO samples achieve 7.55 MT-Bench and 90.06% AlpacaEval scores. We anticipate this work to provide tools on automatic data selection, facilitating data-efficient alignment. We release our models as well as the selected datasets for future researches to effectively align models more efficiently.

For agents

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

get_harvested_code_for_paper("2312.15685")
get_code_for_paper("2312.15685")
have("2312.15685")

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

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

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

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

Connect an agent — have() is free.