Web Analytics

FAC-Synthesis

⭐ 97 stars Indonesian by Zhongzhi660

🌐 Bahasa

Less is Enough: Sintesis Data Beragam di Ruang Fitur LLM

Ini adalah implementasi resmi dari makalah: Less is Enough: Synthesizing Diverse Data in Feature Space of LLMs.


Inti Utama

Bekerja lebih cerdas, bukan lebih keras.

Pada tahap pelatihan lanjutan LLM, alih-alih menambahkan sejumlah besar teks permukaan yang beragam secara membabi buta, jauh lebih efektif untuk secara tepat mengidentifikasi dan mensintesis fitur kunci yang benar-benar hilang. Dengan hanya sejumlah kecil sampel sintetis yang terarah, kita dapat secara signifikan mengisi kekosongan dalam Feature Activation Coverage (FAC), menghasilkan peningkatan kinerja yang jelas pada tugas-tugas lanjutan.

Mengapa wawasan ini sederhana namun kuat?

Sintesis data tradisional berfokus pada kuantitas dan keragaman permukaan (kosakata, pola kalimat, distribusi topik), namun ini seringkali hanya merupakan indikator lemah. Yang benar-benar menentukan kinerja model pada tugas lanjutan adalah cakupan fitur kunci yang dibutuhkan oleh tugas target.

Penelitian kami mengungkapkan:

Gambar 1: Frontier Efisiensi Dataset Instruksi. Metode yang kami usulkan mencapai Win Rate di AlpacaEval 2.0 yang sebanding dengan MAGPIE namun hanya menggunakan 2K sampel sintetis (vs. 300K untuk MAGPIE).


Memulai

Instalasi

git clone https://github.com/Zhongzhi660/FAC-Synthesis.git
cd FAC-Synthesis
pip install -r requirements.txt


Repository Structure

FAC-Synthesis/
├── LICENSE
├── README.md
├── requirements.txt
│
├── sae_pretrain/                 # SAE pretraining
│   ├── datasets/                 # pretraining corpora (constructed from public sources)
│   └── outputs/                  # SAE pre-trained weights
│
├── sae_feature_analysis/         # SAE feature analysis pipeline
│   ├── interpret_features/       # feature interpretation (span collection + annotation)
│   ├── identify_task_relevant_features/   # task-relevant feature identification
│   └── identify_missing_features/         # missing-feature discovery (coverage gap)
│
├── fac_synthesis/                # FAC synthesis pipeline
│   ├── step1_contrastive_pair_construction/      # Step-1: contrastive pair construction
│   └── step2_feature_covered_sample_synthesis/   # Step-2: feature-covered synthesis
│
└── training_scripts/             # Downstream training / evaluation scripts
    ├── toxicity_detection/
    ├── reward_modeling/
    ├── instruction_following/
    └── behavior_steering/

Pralatih Sparse Autoencoders

Sebagian besar skrip untuk pretraining SAE terletak di sae_pretrain/. Kami menyediakan checkpoint SAE yang sudah dilatih sebelumnya di Hugging Face: Untuk melakukan pretraining SAE, jalankan perintah berikut:

# Step-1: Collect hidden activations from the backbone LLM (e.g., layer 16)
python create_actvs_uni.py 0 0 1 meta-llama/Llama-3.1-8B-Instruct 16

Step-2: Train SAEs on the target layer (e.g., layer 16)

python train_SAEs.py 0 16 meta-llama/Llama-3.1-8B-Instruct /sae_input/prompt_actvs_l16

Menganalisis fitur SAE

Skrip analisis fitur terletak di sae_feature_analysis/. Untuk mengelompokkan rentang aktivasi dan menghasilkan interpretasi fitur yang mudah dibaca manusia, jalankan:

# Step-1: Group extracted activation spans
python groupby_textspans.py /xxx/threshold_0.0

Step-2: Annotate feature explanations based on grouped spans

python annotate_explanations.py /xxx/threshold_0.0.tsv

Step-3: Identify task-relevant features from the explanations

python annotate_toxicity.py /xxx/threshold_0.0_explained.tsv

Step-4: Identify missing features via FAC analysis

python identify_fac.py anchor_features.tsv (complete) task_features.tsv (currently available)

Sintesis data berbasis cakupan

Skrip sintesis berbasis cakupan terletak di fac_synthesis/. Untuk menghasilkan kueri sintetis, jalankan

# Step-1 (1): Contrastive Pair Construction
python generate_data_llama_r1.py \
  --features xxx.tsv \
  --out xxx \
  --temperature 0.8

Step-1 (2): Feature-Covered Sample Synthesis

python analyze_step1_synthetic_data.py python merge_step1_failed_cases.py

Step-2: Feature-Covered Sample Synthesis

python generate_data_llama_r2.py \ --features xxx.tsv \ --out xxx \ --temperature 0.8


Ucapan Terima Kasih

Pada tahap evaluasi, skrip pelatihan dan pengujian downstream kami diadaptasi dari repositori open-source berikut:

Sitasi

Jika Anda merasa pekerjaan ini bermanfaat untuk riset Anda, silakan sitasi makalah kami 🤩:

@article{li2026less,
  title={Less is Enough: Synthesizing Diverse Data in Feature Space of LLMs},
  author={Li, Zhongzhi and Wu, Xuansheng and Li, Yijiang and Hu, Lijie and Liu, Ninghao},
  journal={arXiv preprint arXiv:2602.10388},
  year={2026}
}

--- Tranlated By Open Ai Tx | Last indexed: 2026-05-27 ---