CoolFace
Modelpublic

ssfc/pcf-qwen3.5-9b-detail-to-detail-lora

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes13downloads
Model Card

PCF Qwen3.5-9B Detail-to-Detail LoRA

This repository contains an experimental lightweight LoRA adapter for Qwen/Qwen3.5-9B trained for the Past-Creates-Future (PCF) algorithm-idea generation workflow.

The model is trained to transform structured details of an existing algorithm plus a mechanism-level method delta into structured details of a possible improved algorithm:

text
existing method detail + method delta -> new method detail

This adapter is intended as a smaller alternative to the stronger Qwen/Qwen3-14B PCF detail-to-detail adapter. In local PCF evaluation it produced stable JSON outputs, but did not outperform the Qwen3-14B detail-to-detail adapter.

Model Details

  • —Base model: Qwen/Qwen3.5-9B
  • —Adapter type: LoRA / PEFT
  • —Task type: causal language modeling
  • —LoRA rank: 16
  • —LoRA alpha: 16
  • —LoRA dropout: 0.05
  • —Target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
  • —Training dtype: bf16

Intended Use

This model is intended for algorithm-research ideation:

  • —generating structured candidate algorithm details;
  • —applying a reusable method delta to an existing algorithm;
  • —producing implementation-oriented sketches before manual coding;
  • —comparing PCF behavior across base models.

Generated algorithm claims should be treated as hypotheses. They require human inspection, implementation, and benchmark validation.

Input Format

The input prompt contains structured existing method details with fields such as:

text
problem_definition
method_name
method_type
core_idea
key_components
input_output
optimization_objective
algorithm_flow
assumptions
limitations
novelty_claim
prior_work_relation
transferable_delta_hints

The method delta contains fields such as:

text
new_title
problem_shift
method_delta
component_changed
mechanism_added
mechanism_removed
abstraction_shift
why_improves
reuse_pattern
delta_keywords

The expected output is valid JSON with the same method-detail fields.

Usage

python
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig

base_model = "Qwen/Qwen3.5-9B"
adapter = "ssfc/pcf-qwen3.5-9b-detail-to-detail-lora"

tokenizer = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True)
quantization_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_compute_dtype=torch.bfloat16,
    bnb_4bit_use_double_quant=True,
    bnb_4bit_quant_type="nf4",
)
model = AutoModelForCausalLM.from_pretrained(
    base_model,
    device_map="auto",
    quantization_config=quantization_config,
    trust_remote_code=True,
)
model = PeftModel.from_pretrained(model, adapter)
model.eval()

For the prompt construction used in this project, see finetune/inference_detail.py in the Past-Creates-Future repository.

Training Data

Training data file:

text
deepseek_method_delta_details_v4_flash_30k5562_detail_to_detail_conf0p6.jsonl

The dataset was built from algorithm papers. The pipeline extracts structured method details for old and new methods, summarizes method deltas, filters examples by confidence, and formats examples as:

text
existing detail + delta detail -> new detail

This version uses a 30k-character extraction context and a confidence threshold of 0.6.

Training Configuration

  • —Epochs: 3
  • —Total steps: 951
  • —Per-device batch size: 1
  • —Gradient accumulation steps: 16
  • —Learning rate: 1e-4
  • —Scheduler: cosine
  • —Max sequence length: 4096
  • —Optimizer: paged AdamW 8-bit
  • —Gradient checkpointing: enabled
  • —Liger kernel: enabled
  • —Training runtime: about 11 hours 22 minutes on a single 24 GB NVIDIA GPU
  • —Final training loss: 1.222

Local Evaluation

Local held-out PCF evaluation with 24 examples:

text
valid_json_rate: 1.0
detail_fields_rate: 1.0
mean_keyword_coverage: 0.232
mean_compact_reference_word_jaccard: 0.246
mean_output_chars: 4009

Comparison against the Qwen3-14B detail-to-detail adapter on the same 24-example split:

text
Qwen3.5-9B mean_keyword_coverage: 0.232
Qwen3-14B  mean_keyword_coverage: 0.260

The Qwen3.5-9B adapter is therefore useful as a lightweight experimental alternative, while the Qwen3-14B detail-to-detail adapter remains the stronger default in local PCF experiments.

Limitations

  • —The model may produce plausible but unverified algorithm mechanisms.
  • —It can sometimes preserve too much of the old method detail and apply the delta less aggressively than the Qwen3-14B adapter.
  • —Output quality depends strongly on the quality of the input method detail and delta.
  • —It is specialized for algorithmic method-delta ideation, not general chat or final research claims.

Recommended Workflow

Use this model to generate candidate method details, then:

  1. 1.inspect whether the mechanism is coherent;
  2. 2.translate promising ideas into code;
  3. 3.run controlled benchmarks;
  4. 4.compare against the relevant baseline.