zengrh3's picture
Add files using upload-large-folder tool
cb3f888 verified
|
Raw History Blame Contribute Delete
6.5 kB
metadata
license: mit
language:
  - en
pretty_name: MemLoop SFT v5 — proactive callback data
tags:
  - memory
  - agents
  - long-term-memory
  - longmemeval
  - multi-agent
  - feedback
  - sft
size_categories:
  - 10K<n<100K
task_categories:
  - text-generation
configs:
  - config_name: sft
    data_files:
      - split: train
        path: sft/train.jsonl

MemLoop SFT v5: proactive callback (feedback) data

Supervised fine-tuning data that teaches the three agents of a memory system (memory, retrieval, answer) to notice a problem on their own, write a specific feedback, and redo the work after receiving feedback ("callbacks"). All rows are built on the LongMemEval SFT split; no dev or test data is included.

Format ("prompt I")

Every agent answers with exactly one tool call. Its arguments end with two callback fields:

  • revisit_agent: none, the agent itself, or an upstream agent (memory ← retrieval ← answer).
  • feedback: empty for none, otherwise a short, specific description of what is wrong or missing.

An agent asked to redo its work sees Feedback from <agent>: in its input, and every input ends with Callback budget: N (1 callback per agent, at most 3 per trajectory). Memory inputs are JSON; the feedback is a feedback field there. The answer agent's prompt asks for written-month dates in both reasoning and answer (ISO dates in those two fields were rewritten).

Files

Path Content
sft/train.jsonl 40,320 training rows: system, instruction, output, metadata
sft/tokenized/ The same rows tokenized for Qwen3-4B-Instruct-2507 (qwen3_nothink template, LLaMA-Factory tokenized_path), with loss masking applied (labels == -100)
sft/reserve.jsonl Spare v3 rows used only to replace rows dropped for length (none were dropped)
sft/report.json Per-type counts, row counts by role and source, tokenization checks
trajectories/<run>.jsonl.gz Raw callback trajectories, one file per generation run; each line is one trajectory (steps, per-call calls with inputs and responses, construction = what was deliberately broken)
question-pools/*.jsonl.gz Newly written questions (synthetic date / counting / listing / granularity questions; preference questions), each verified by an independent second call
quality/sft-v5.jsonl Four-check quality review of every callback trajectory
manifest.json Per run: error type, models, number of trajectories, skipped constructions, sha256

Row metadata

  • row_role: core, episodic, semantic, procedural (memory banks), retrieval, answer.
  • source: callback-decision (the call that issued a callback), callback-redo (calls after receiving feedback), hard-negative (a trap was present, no callback, final answer correct), v3 (earlier SFT rows converted to this format with revisit_agent: none).
  • error_type: 1–16 (below); run and trajectory point into trajectories/.
  • loss_from_char: for callback-decision rows, loss starts at this character of output (the callback fields). The flawed first output stays visible but is not trained. Other rows are trained on the full output.

Composition

Role Rows Share
retrieval 20,644 51.2%
answer 9,636 23.9%
memory (core / episodic / semantic / procedural) 10,040 (2,970 / 2,372 / 2,291 / 2,407) 24.9%

Sources: callback-decision 4,384, callback-redo 12,313, hard-negative 4,101, v3 19,522. Trained tokens: 7,113,495; longest row 14,568 tokens.

16 error types (callback trajectories used, target 300 each)

# Error type Stage Passed rules Passed review Used Hard negatives
1 Memory gap (a session's fact never written) memory 810 710 300 115
2 Value dropped (vague entry, value missing) memory 404 295 295 150
3 Wrong fact in memory (incl. two conflicting values) memory 548 511 300 150
4 Memory self-review with a checklist memory 418 (rule 4) 280 150
5 Wording mismatch (question words don't retrieve the entry) memory/retrieval 233 151 142 150
6 Stale Core (Core holds an older value) retrieval/answer 1,011 885 300 150
7 Retrieval gap (search stopped too early) retrieval 403 353 300 150
8 Evidence dropped retrieval 758 719 300 103
9 Distractor ranked first answer 906 772 300 150
10 Distractor vs. Core answer 788 672 300 150
11 Wrong granularity (city vs. state) answer 26 19 19 150
12 Date arithmetic / temporal reasoning answer 440 379 300 150
13 Counting answer 226 171 132 150
14 Listing answer 501 442 300 150
15 Unanswerable (false premise) answer 404 259 259 9
16 Preference / advice answer 552 479 300 150

Types 5, 11 and 13 ran out of source questions and stay below 300.

How it was generated

  • Memory: teacher memory written by Claude Sonnet 4.5 over the LongMemEval SFT split (50 histories), then deliberately broken per error type (drop or change a value, add a distractor entry, move the true fact to Core, add an older value to Core, …) or left intact with a newly written question.
  • Agents: DeepSeek-V4.1-Flash and GLM-5.3-Flash (self-hosted) as retrieval and answer agents. DeepSeek-V4.1-Flash also writes and redoes memory and judges correctness. When an agent fails without calling back, the teacher writes the feedback the agent should have written from the reference answer ("hindsight feedback"), restricted to what that agent could see; the agent then redoes the step. Some types resample the first answer or retrieval at temperature 1.0 to find a natural mistake.
  • Filtering: rule-based filters (callback executed, clean format, final answer correct, memory rewrite verified, feedback does not leak the answer or talk about format, dedup), then a DeepSeek review of every callback trajectory on four checks: cause correct, specific, uses no hidden information, redo follows the feedback. Pass rate on all four checks: 84% for DeepSeek-agent trajectories, 82% for GLM-agent trajectories.

Source and license

Conversations and questions come from LongMemEval (xiaowu0162/longmemeval-cleaned, MIT). This dataset is released under the MIT license.