Papers › Instruction Tuning With Loss Over Instructions

Instruction Tuning With Loss Over Instructions

23 May 2024arXiv:2405.14394archive 2025-07-28

Zhengyan Shi, Adam X. Yang, Bin Wu, Laurence Aitchison, Emine Yilmaz, Aldo Lipani

Instruction tuning plays a crucial role in shaping the outputs of language models (LMs) to desired styles. In this work, we propose a simple yet effective method, Instruction Modelling (IM), which trains LMs by applying a loss function to the instruction and prompt part rather than solely to the output part. Through experiments across 21 diverse benchmarks, we show that, in many scenarios, IM can effectively improve the LM performance on both NLP tasks (e.g., MMLU, TruthfulQA, and HumanEval) and open-ended generation benchmarks (e.g., MT-Bench and AlpacaEval). Remarkably, in the most advantageous case, IM boosts model performance on AlpacaEval 1.0 by over 100%. We identify two key factors influencing the effectiveness of IM: (1) The ratio between instruction length and output length in the training data; and (2) The number of training examples. We observe that IM is especially beneficial when trained on datasets with lengthy instructions paired with brief outputs, or under the Superficial Alignment Hypothesis (SAH) where a small amount of training examples are used for instruction tuning. Further analysis substantiates our hypothesis that our improvement can be attributed to reduced overfitting to instruction tuning datasets. It is worth noting that we are not proposing \ours as a replacement for current fine-tuning processes. Instead, our work aims to provide practical guidance for instruction tuning LMs, especially in low-resource scenarios.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2405.14394")

Code

Syntology Ran 12 of 20 code samples harvested from 1 repository linked to this paper; 8 have no recorded run. Of those that ran: 2 ran · our draft was wrong; 10 ran with no contract checked.

By repository: official repository: 20 samples from 1 repository, 12 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

zhengxiangshi/instructionmodelling officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

20 samples harvested; 12 ran; 0 honoured the contract we drafted; 8 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · our draft was wrong
10ran
8unverified

Licence: 20 of the 20 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from ZhengxiangShi/InstructionModelling. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

add_ref_model_logit_to_columns ZhengxiangShi/InstructionModelling/src/finetune_kl.py official repository ran no licence file found · pointer only · 1447821f32348ac5 · report
compute_kl_divergence_loss ZhengxiangShi/InstructionModelling/src/utils.py official repository ran no licence file found · pointer only · 9104e80d99f2ab8a · report
compute_llm_eval_performance ZhengxiangShi/InstructionModelling/src/get_results_group.py official repository ran no licence file found · pointer only · 969b779909d41a48 · report
encode_with_messages_format ZhengxiangShi/InstructionModelling/src/compute_loss.py official repository ran · our draft was wrong no licence file found · pointer only · 1cb0eeb16cf04ee3 · report
encode_with_messages_format ZhengxiangShi/InstructionModelling/src/finetune.py official repository ran no licence file found · pointer only · 8a32cc283c5e5807 · report
encode_with_messages_format ZhengxiangShi/InstructionModelling/src/finetune_kl.py official repository ran no licence file found · pointer only · fc23892a28f95bc1 · report
encode_with_prompt_completion_format zhengxiangshi/instructionmodelling/src/compute_loss.py official repository ran · our draft was wrong no licence file found · pointer only · c90f3a5ec6457c6d · report
encode_with_prompt_completion_format ZhengxiangShi/InstructionModelling/src/finetune.py official repository ran no licence file found · pointer only · e7170ef85d1fec78 · report
get_human_eval_results ZhengxiangShi/InstructionModelling/src/get_results_group.py official repository ran no licence file found · pointer only · cb1ba0cfe1a9de8a · report
get_instruction ZhengxiangShi/InstructionModelling/src/generate.py official repository ran no licence file found · pointer only · 88c99652268092f3 · report
group_texts ZhengxiangShi/InstructionModelling/src/compute_loss.py official repository ran no licence file found · pointer only · d09e0781a55d3694 · report
neftune_post_forward_hook ZhengxiangShi/InstructionModelling/src/utils.py official repository ran no licence file found · pointer only · 8813cfd84beec509 · report
compute_kl_divergence_loss_target_token ZhengxiangShi/InstructionModelling/src/utils.py official repository unverified no licence file found · pointer only · c46f87d3e93c4108 · report
compute_model_performance ZhengxiangShi/InstructionModelling/src/get_results_group.py official repository unverified no licence file found · pointer only · 9cc81ad65b572087 · report
create_prompt_with_tulu_chat_format ZhengxiangShi/InstructionModelling/src/generate.py official repository unverified no licence file found · pointer only · 697d92a5d51eff3e · report
encode_few_shot_example ZhengxiangShi/InstructionModelling/src/instruction_encode_templates.py official repository unverified no licence file found · pointer only · 96351a65183bb428 · report
encode_instruction_example ZhengxiangShi/InstructionModelling/src/instruction_encode_templates.py official repository unverified no licence file found · pointer only · f839fd4c6f96a26f · report
main zhengxiangshi/instructionmodelling/src/compute_loss.py official repository unverified no licence file found · pointer only · e5ce78b681258794 · report
parse_args zhengxiangshi/instructionmodelling/src/compute_loss.py official repository unverified no licence file found · pointer only · 1c89153db0460637 · report
should_be_filtered ZhengxiangShi/InstructionModelling/src/reformat_datasets.py official repository unverified no licence file found · pointer only · 08f4816632095bc7 · report

Tasks

HumanEvalMMLUTruthfulQA

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections