Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM4Res

2026 LLM-Rec 比赛 7 月初赛阶段工作仓库。

当前主线入口

任何线上评测前,先运行本地 Stage 0 流水线:

PYTHON=python3 ./scripts/run_stage0_local.sh

这是当前主线入口,不会消耗线上评测次数。它会完成任务分流推理、Pass@64 风格候选生成、提交前校验、本地评估和实验记录。

主要产物:

outputs/stage0_routed_predictions.jsonl
outputs/stage0_candidates.jsonl
outputs/stage0_config.json
outputs/stage0_eval_summary.json
experiments/runs.jsonl

仓库文件说明见:docs/repo_map.md

目录结构

  • data/:原始样例数据和数据处理说明。
  • src/:预处理、推理、后处理、校验和实验记录脚本。
  • scripts/:可直接运行的本地工作流。
  • docs/:执行计划、平台信息和仓库地图。
  • experiments/:本地实验记录。
  • configs/base.yaml:固定比赛模型和基础配置。

生成数据、预测结果、模型权重和虚拟环境都被 .gitignore 忽略。代码、配置、脚本和文档进入版本管理;大文件产物留在本地或专用存储。

任务类型

  • world:常识/知识问答。
  • material:物料理解。
  • user:用户兴趣演化与结构化逻辑。
  • rec:跨域推荐。

固定比赛模型

比赛主线模型固定为:

OpenOneRec/OneReason-0.8B-pretrain-competition

不要私自切换基础模型做提交主线。其他模型只能作为明确标记的非提交实验。

Stage 0 本地准备

运行:

PYTHON=python3 ./scripts/run_stage0_local.sh

该脚本会执行:

  1. src/preprocess.py 生成标准训练 JSONL。
  2. src/routed_infer.pyworld/material/user/rec 分流推理。
  3. src/generate_candidates.py 生成 Pass@64 风格候选。
  4. src/validate_submission.py 做提交前校验。
  5. src/eval.py 生成本地评估结果。
  6. src/record_experiment.py 写入实验记录。

校验通过时会看到类似输出:

{"ok": true, "rows": 13}

本地评估器会输出接近官方口径的代理指标:

  • world_accuracyworld 选择题完全匹配。
  • pass_at_64recmaterial text->token 候选命中。
  • set_f1user 兴趣 token 集合 F1。
  • json_validuser 逻辑链 JSON 合法性。
  • exact_match:保留为 sanity 对比指标。

注意:本地评估不能复刻官方 LLM-as-Judge 和隐藏集评分。

本地模型实验

如果需要在本机加载比赛模型,先准备环境:

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements-local.txt

运行本地模型 basecase:

PYTHON=.venv/bin/python ./scripts/run_local_basecase.sh

产物:

outputs/local_predictions.jsonl
outputs/local_predictions.postprocessed.jsonl

运行最小 LoRA smoke/basecase:

PYTHON=.venv/bin/python ./scripts/run_local_lora_smoke.sh

产物:

outputs/lora_adapter/

运行 answer-only SFT LoRA:

PYTHON=.venv/bin/python ./scripts/run_answer_only_lora.sh

产物:

data/processed/train_answer_only.jsonl
outputs/lora_answer_only_adapter/
outputs/local_answer_only_lora_predictions.postprocessed.jsonl
outputs/local_answer_only_lora_eval.json

后处理

对任意本地预测文件做任务专用清洗:

python3 src/postprocess.py \
  --input outputs/local_lora_predictions.jsonl \
  --output outputs/local_lora_predictions.postprocessed.jsonl \
  --labels data/processed/train.jsonl

Sanity Baseline

以下脚本只用于检查基础管线是否通,不是冲榜主线:

./scripts/run_baseline.sh

产物:

data/processed/train.jsonl
data/processed/summary.json
outputs/predictions.jsonl
outputs/eval_summary.json

如果只想手动跑 sanity pipeline:

python3 src/preprocess.py \
  --input-dir data \
  --output data/processed/train.jsonl \
  --summary data/processed/summary.json

python3 src/infer.py \
  --input data/processed/train.jsonl \
  --output outputs/predictions.jsonl

python3 src/eval.py \
  --labels data/processed/train.jsonl \
  --predictions outputs/predictions.jsonl \
  --output outputs/eval_summary.json

src/infer.py --oracle 只用于管线自检,不用于真实评估。

StreamLake 数据集导出

StreamLake SFT 控制台需要 systempromptresponse 字段。导出命令:

python3 src/export_platform_dataset.py \
  --input data/processed/train.jsonl \
  --output data/processed/streamlake_prompt_response.jsonl

开赛首日最短路径

  1. 获取或确认官方数据入口。
  2. 将官方数据接入 src/preprocess.py
  3. 运行:
PYTHON=python3 ./scripts/run_stage0_local.sh
  1. 通过 src/validate_submission.py 后,再决定是否消耗线上评测次数。

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages