posix-sdc
收藏资源简介:
POSIX Self-Directed Citizen(posix-sdc)是一个经过验证的、自导向的、自终止的合成POSIX shell轨迹数据集。其核心特点是语言模型在没有任何明确任务提示的情况下登录到真实的POSIX shell环境中,通过读取环境信息(如motd、环境变量、文件或提供程序的--help文档)自主发现任务,使用系统提供的工具完成任务,并通过exit(成功完成)或panic(真正受阻)结束会话。每个轨迹的最终结果都根据真实文件系统状态进行了验证,确保标签可靠性。数据集包含两个主要配置文件:trajectories.jsonl(监督微调语料库,包含每个保留轨迹的详细执行记录)和scenarios.jsonl(可重现的场景包,包含任务世界定义)。数据集中定义了18种任务原型,涵盖四大类别:文件与文本操作(如文件转换、文本替换、日志提取、搜索计数、配置编辑、追加记录、合并文件、分割文件、校验和计算)、文件系统与结构(如创建结构、重命名文件、清理文件、权限设置)、脚本与管道(如修复损坏脚本、多步骤管道)以及复合与终端策略(如多任务、空队列、阻塞任务)。数据生成过程包括四个阶段:教师模型创作场景、操作模型在可丢弃容器中执行场景、根据最终状态验证效果、记录符合条件的轨迹。数据集采用按原型保留的分割策略,将text_replace和permissions两个原型作为保留集,用于评估模型在未见任务类型上的泛化能力。数据集规模为数百个轨迹,所有轨迹均由qwen2.5:32b模型操作生成。数据集附带客观的机器可运行评分器(checker),可作为跨参与者基准测试,支持将相同任务应用于模型或人类进行能力比较。
POSIX Self-Directed Citizen (posix-sdc) is a validated, self-directed, self-terminating synthetic POSIX shell trajectory dataset. Its core feature is that the language model logs into a real POSIX shell environment without any explicit task prompts, autonomously discovers tasks by reading environmental information such as motd, environment variables, files, or the --help documentation of provided programs, completes tasks using system-provided tools, and terminates the session via exit (for successful completion) or panic (for genuine blockage). The final outcome of each trajectory is validated against the real file system state to ensure label reliability. The dataset contains two primary configuration files: trajectories.jsonl (a supervised fine-tuning corpus containing detailed execution records for each retained trajectory) and scenarios.jsonl (a reproducible scenario package including task world definitions). Eighteen task prototypes are defined in the dataset, covering four major categories: File and Text Manipulation (e.g., file conversion, text replacement, log extraction, search and counting, configuration editing, record appending, file merging, file splitting, checksum calculation), File System and Structure (e.g., structure creation, file renaming, file cleaning, permission setting), Scripts and Pipelines (e.g., fixing broken scripts, multi-step pipelines), and Composite and Terminal Strategies (e.g., multi-tasking, empty queue, blocking tasks). The data generation process consists of four stages: scenario creation by a teacher model, scenario execution by an actor model in a disposable container, effect validation based on the final state, and recording eligible trajectories. The dataset adopts a prototype-based retention splitting strategy, taking the text_replace and permissions prototypes as the reserved set for evaluating the generalization ability of models on unseen task types. The dataset contains hundreds of trajectories, all generated by the qwen2.5:32b model. The dataset is accompanied by an objective, machine-runnable checker that can serve as a cross-participant benchmark, supporting the application of the same tasks to models or humans for capability comparison.
POSIX Self-Directed Citizen (posix-sdc)
数据集概述
一个经过验证的、自我导向的、自我终止的合成 POSIX shell 轨迹数据集。每个轨迹代表一个语言模型在 shell 环境中,没有任务提示,自主从环境中发现自身任务并执行,最终离开。所有轨迹的结果都基于真实的文件系统状态进行验证,标签可信。
核心特点:不是工具调用(tool-calling)。模型没有预定义的函数 API,而是直接面对真实的 shell 提示符,像人类一样通过 --help、man、ls、阅读文件等方式发现和操作系统。行为边界由操作系统本身定义。
任务描述:自我导向的公民
模型被赋予一个真实系统的账户,登录到 POSIX shell 后,通过阅读环境(motd、环境变量、文件、提供程序的 --help)发现自己的任务,利用系统提供的工具完成任务,并以 exit(完成)或 panic(真正受阻)结束会话。
模型必须执行的通用行为模式:
- 预期任务指令的公布位置
- 通过任务提供者的自我文档理解其用法
- 检索指令
- 执行指令,然后终止
任务原型(18种)
轨迹的 archetype 字段记录任务类型,大部分以干净的 exit 结束,两种编码了终端策略(何时无事可做时停止,何时放弃)。
| 类别 | 原型 |
|---|---|
| 文件和文本操作 | file_transform(转换文件)、text_replace(替换字符串)、log_extract(提取日志行)、search_count(搜索并统计)、config_edit(编辑配置)、append_record(追加记录)、merge_files(合并文件)、split_file(分割文件)、checksum(计算校验和) |
| 文件系统和结构 | create_structure(创建目录树)、rename_files(重命名文件)、cleanup(清理文件)、permissions(设置权限) |
| 脚本和管道 | fix_broken_script(修复错误脚本)、multi_step_pipeline(组合多步管道) |
| 复合和终端策略 | multi_ticket(多个独立指令)、empty_queue(无任务,干净退出)、blocked_ticket(无法完成,panic) |
每个场景还变化了发现提供者的方式(子命令 CLI、标志 CLI、纯文本文件、环境变量指针)和公告方式(motd、登录横幅、README、环境变量),以概括跨接口的发现能力。
数据生成方法
采用强教师模型("Master Foo":qwen2.5:32b)编写场景并操作。四阶段流程:
- A. 编写:教师编写场景(指令提供程序、公告、固件、确定性检查器、参考解决方案),只有参考解决方案通过检查器才被接受
- B. 执行:操作模型在一次性通用 Linux OCI 容器中驱动场景,只有通用框架,无任务
- C. 验证:检查器运行于容器的最终状态,评估命令产生的效果
- D. 记录:仅保留效果存在且终端正确的轨迹,剥离框架,保留环境轮次和模型命令
操作模型选择:qwen2.5:32b 在配对比较中优于 llama3.1:8b(44% vs 19% 干净轨迹),除非另有标注,所有轨迹均由 qwen2.5:32b 操作。
数据文件与结构
位于 data/ 目录,包含两个配置文件:
trajectories(data/trajectories.jsonl):SFT 语料库,每个轨迹一行scenarios(data/scenarios.jsonl):可复现的世界,每个场景一行
trajectories 字段
| 字段 | 类型 | 含义 |
|---|---|---|
id |
str | 内容寻址:<archetype>_<sha256(turns)[:12]> |
version |
str | 该记录首次出现的数据集版本 |
scenario_id |
str | 运行的场景 ID |
archetype |
str | 任务类型 |
environment |
obj | 运行的发行版 / shell / coreutils / 包管理器 |
terminal |
str | exit 或 panic |
verified |
bool | 检查器是否通过最终状态 |
outcome |
str | success 或 correct_panic |
operator_model |
str | 产生轨迹的模型 |
turns |
list | {role, content} 消息:system、user(环境)、assistant(命令) |
scenarios 字段
| 字段 | 类型 | 含义 |
|---|---|---|
id、archetype、terminal |
str | 身份标识 |
version |
str | 首次出现的版本 |
split |
str | train 或 holdout(按完整原型保留) |
environment |
obj | 环境配置 |
provider |
obj | 指令提供者(kind、name、help、files) |
announcement |
obj | 入口线索 |
directives |
list | 赋值指令 |
fixtures |
obj | 路径到内容的种子数据 |
checker |
str | shell 脚本,exit 0 表示效果存在 |
reference_solution |
list | 满足检查器的命令 |
所有 ID 都是内容寻址的(<archetype>_<sha256(content)[:12]>),确保跨生成运行的稳定性。
数据划分与泛化协议
scenarios.jsonl 将两个完整原型标记为 holdout:
text_replace(文件/文本)permissions(文件系统元数据)
它们被特意设置为不相似,以评估操作与终止机制在不同类型任务上的泛化能力。终端策略原型(empty_queue、blocked_ticket)从不保留。轨迹仅来自 train 原型,评估方式为按原型的行为测试。
基准视图(xapi/)
每个场景携带一个机器运行的评分器(checker),数据集可作为跨角色的基准。xapi/ 目录将运行记录投影到 xAPI 语句,支持框架化的能力评估。
支持的实验结果
在配套实验中,使用此数据对 mistral:7b-instruct-v0.2 进行微调,使得在原型级别的保留场景上的终止率从 0/16(基础模型)提升至 9/16(微调模型),操作/终止机制泛化到了未见过的原型。
局限性
- 规模小:几百条轨迹,一个教师,一个生成协议
- 操作模型
qwen2.5:32b的干净轨迹率约 40%,保留集偏向较容易的场景 - 在
dash(Alpine)中生成,命令语义可能与其他目标环境略有差异 multi_step_pipeline原型代表性不足
许可与引用
- 许可:CC-BY-4.0
- 引用:使用本数据集请注明 "posix-sdc by Tiara Rodney" 并链接本仓库





