Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# OpenSeek Submission

This directory contains the final open-source submission for the
`LongContext-ICL-Annotation` track.

## Included Files

- `技术报告-OpenSeek.pdf`
- Final technical report PDF used for the competition submission.
- `submission.zip`
- Exact 8-task prediction archive submitted on the platform.
- `源代码-OpenSeek.zip`
- Exact source-code archive included in the final competition submission.
- `code/`
- Extracted source tree for direct review, including configs, prompts,
scripts, tests, and usage documentation.

## Method Summary

The solution uses `Qwen3-4B` as the only large language model and uses
`FlagScale` as the required runtime framework. The pipeline combines:

- long-context example retrieval and compression
- front-back evidence reordering
- multi-protocol first-pass inference
- confidence-based recheck and adjudication
- deterministic post-processing for selected tasks
- submission validation and packaging

The final confirmed platform score for this submission line is `87.35`.

## Reproduction

See [code/README.md](code/README.md) for environment setup, data preparation,
FlagScale deployment, inference, evaluation, packaging, and validation.

## Scope

This submission only adds files under:

`openseek/competition/LongContext-ICL-Annotation/submissions/OpenSeek/`
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Python and local tooling
.venv/
venv/
__pycache__/
*.py[cod]
*.pyo
*.pyd
.pytest_cache/
.mypy_cache/
.ruff_cache/
.coverage
htmlcov/

# OS/editor noise
.DS_Store
Thumbs.db
*.swp
*.swo

# OpenBayes workspace-local state
.openbayesgear

# Official data and generated caches.
# Keep only README/.gitkeep placeholders under version control.
data/raw/*
!data/raw/.gitkeep
data/processed/*
!data/processed/.gitkeep
data/openbayes_cache/*

# Runtime outputs, logs, pulled remote artifacts, reports, submissions, and zips.
# Release metadata that should be versioned belongs under docs/.
outputs/*
submission*.zip
*.zip

# Generated document intermediates
report/.technical_report.normalized-headings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.git
.git/
.git/**
.pytest_cache
.pytest_cache/
__pycache__
__pycache__/
*.pyc
.venv
.venv/
outputs
outputs/
outputs/**
data/raw
data/raw/
data/raw/**
data/processed
data/processed/
data/processed/**
*.zip
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Code Package Notes

This archive is the official code package for submission review.

Included:
- source code under `src/`
- runnable scripts under `scripts/`
- configs under `configs/`
- prompts under `prompts/`
- tests under `tests/`
- `README.md` and `requirements.txt`

Intentionally excluded:
- generated outputs and caches
- temporary folders and local review artifacts
- report sources and PDF exports
- internal release notes and development-only documents
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
PYTHON ?= python3
CONFIG ?= configs/base.yaml

.PHONY: prepare predict eval package test release-check release-check-dirty

prepare:
./scripts/import_official_data.sh $(DATA_DIR)

predict:
$(PYTHON) -m src.main predict --config $(CONFIG)

eval:
$(PYTHON) -m src.main evaluate --config $(CONFIG)

package:
$(PYTHON) -m src.main package --config $(CONFIG)

test:
$(PYTHON) -m pytest -q

release-check:
$(PYTHON) scripts/release_preflight.py

release-check-dirty:
$(PYTHON) scripts/release_preflight.py --allow-dirty
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# AI-LAB OpenSeek Submission

面向 OpenSeek `LongContext-ICL-Annotation` 赛题的可复现参赛工程。

本项目基于 `Qwen3-4B` 构建统一的 8 任务自动标注流程,核心链路包括:

- 长上下文示例检索与压缩
- `front-back` 证据重排
- 多协议首轮推理
- 一致性与置信度判断
- 低置信样本复核
- 提交校验与统一打包

## 环境要求

- Python 3.10+
- 可用的 Qwen3-4B 权重目录
- 官方比赛数据目录
- 若采用正式部署路径,使用 FlagScale 作为模型加载与服务框架

安装依赖:

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

## 目录说明

```text
AI-LAB/
├── configs/ 运行配置
├── data/ 数据目录约定与缓存目录
├── prompts/ 各任务提示词协议
├── scripts/ 运行、校验与打包脚本
├── src/ 主流程实现
├── tests/ 基础回归测试
└── requirements.txt 环境依赖
```

## 数据准备

将官方数据导入到 `data/raw/openseek/`:

```bash
./scripts/import_official_data.sh /path/to/LongContext-ICL-Annotation/data
```

## 快速运行

本地 smoke:

```bash
./scripts/run_infer.sh configs/local_smoke.yaml
./scripts/run_eval.sh configs/local_smoke.yaml
./scripts/package_submission.sh configs/local_smoke.yaml
```

标准运行:

```bash
./scripts/run_infer.sh configs/base.yaml
./scripts/run_eval.sh configs/base.yaml
./scripts/package_submission.sh configs/base.yaml
```

## FlagScale 部署路径

若采用 FlagScale 服务化推理,先按实际模型路径修改
`configs/flagscale_serve.template.yaml`,然后启动服务:

```bash
flagscale run -p configs -n flagscale_serve.template -a run \
serve.0.engine_args.model=/path/to/Qwen3-4B \
serve.0.engine_args.port=2026 \
+serve.0.engine_args.max_model_len=32768 \
+serve.0.engine_args.max_num_seqs=1 \
serve.0.engine_args.gpu_memory_utilization=0.88
```

随后运行正式配置:

```bash
./scripts/run_infer.sh configs/openbayes_flagscale_full.yaml
./scripts/run_eval.sh configs/openbayes_flagscale_full.yaml
./scripts/package_submission.sh configs/openbayes_flagscale_full.yaml
```

## 结果校验

任务 8 静态检查:

```bash
python3 scripts/check_task8_predictions.py outputs/predictions/openseek-8-v1.jsonl
```

任务 8 运行代理检查:

```bash
python3 scripts/check_task8_runtime.py outputs/predictions/openseek-8-v1.jsonl
```

完整发布预检:

```bash
make release-check
```

## 关键文件

- 主流程:`src/ai_lab/pipeline.py`
- 官方数据读取:`src/ai_lab/adapters/official_reader.py`
- 检索与重排:`src/ai_lab/retrieval/`
- 决策与投票:`src/ai_lab/decision/`
- 输出解析:`src/ai_lab/output_parser.py`
- 提交校验:`src/ai_lab/submit/validate_submission.py`

## 当前交付物

在本次 OpenSeek 官方仓库提交中,对应交付物位于上一级目录:

- 最终预测包:`../submission.zip`
- 最终代码包:`../源代码-OpenSeek.zip`
- 正式技术报告 PDF:`../技术报告-OpenSeek.pdf`
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
experiment:
team_name: your-team
project_name: longcontext-icl-annotation
seed: 42

model:
name: Qwen/Qwen3-4B
backend: heuristic
device: cuda
dtype: bfloat16
load_in_4bit: true
bnb_4bit_compute_dtype: float16
bnb_4bit_quant_type: nf4
bnb_4bit_use_double_quant: true
max_context_tokens: 32768
max_new_tokens: 512
temperature: 0.0
top_p: 0.95
repetition_penalty: 1.0
trust_remote_code: true
model_path: models/Qwen3-4B
tokenizer_path: models/Qwen3-4B
api_url: http://0.0.0.0:2026/v1/completions
api_model_name: Qwen3-4B
timeout_seconds: 600

data:
registry_path: configs/datasets/registry.yaml
raw_root: data/raw
official_data_dir: data/raw/openseek
processed_root: data/processed
prediction_root: outputs/predictions

icl:
selector: lexical_topk
num_examples: 64
chunk_budget_tokens: 24000
reserve_generation_tokens: 1024
multi_turn_memory: summary_trace
example_template: plain
prefer_long_context: true
small_text_threshold_chars: 1800
chunk_size_chars: 896
chunk_overlap_chars: 96
retrieval_top_k: 8

prompt:
system_prompt_path: configs/prompts/system_prompt.txt
output_format_path: configs/prompts/output_format.txt
protocol_a_path: prompts/protocol_a.yaml
protocol_b_path: prompts/protocol_b.yaml
protocol_c_light_path: prompts/protocol_c_light.yaml
protocol_c_path: prompts/protocol_c.yaml
protocol_a_variant_path: prompts/variants/protocol_a_v2.yaml
code_generation_protocol_path: prompts/code_generation.yaml

decision:
accept_threshold: 0.82
variant_threshold: 0.82
adjudication_threshold: 0.68

runtime:
log_dir: outputs/logs
overwrite: true
save_prompts: false
max_samples_per_task: null

submission:
zip_name: submission.zip
required_prediction_files:
- openseek-1-v1.jsonl
- openseek-2-v1.jsonl
- openseek-3-v1.jsonl
- openseek-4-v1.jsonl
- openseek-5-v1.jsonl
- openseek-6-v1.jsonl
- openseek-7-v1.jsonl
- openseek-8-v1.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
datasets:
- task_id: 1
file_name: openseek-1_closest_integers.json
task_name: closest_integers
task_type: classification
min_context_length: 30000
- task_id: 2
file_name: openseek-2_count_nouns_verbs.json
task_name: count_nouns_verbs
task_type: classification
min_context_length: 30000
- task_id: 3
file_name: openseek-3_collatz_conjecture.json
task_name: collatz_conjecture
task_type: classification
min_context_length: 30000
- task_id: 4
file_name: openseek-4_conala_concat_strings.json
task_name: conala_concat_strings
task_type: classification
min_context_length: 30000
- task_id: 5
file_name: openseek-5_semeval_2018_task1_tweet_sadness_detection.json
task_name: semeval_2018_task1_tweet_sadness_detection
task_type: classification
min_context_length: 30000
- task_id: 6
file_name: openseek-6_mnli_same_genre_classification.json
task_name: mnli_same_genre_classification
task_type: classification
min_context_length: 30000
- task_id: 7
file_name: openseek-7_jeopardy_answer_generation_all.json
task_name: jeopardy_answer_generation_all
task_type: generation
min_context_length: 30000
- task_id: 8
file_name: openseek-8_kernel_generation.json
task_name: kernel_generation
task_type: code_generation
min_context_length: 16000
Loading