Hypernetworks that update LLMs to remember factual information https://arxiv.org/abs/2602.15902
Find a file
2025-05-13 16:44:33 +00:00
chat_templates webui working (not yet two loras) 2025-05-13 10:49:31 +00:00
configs medium fw qa 3 + fallback to manual cache dataset 2025-05-10 15:31:08 +00:00
data/raw_datasets ctx numbers is now reconstruction prompt 2025-01-08 16:16:43 +00:00
eval_results/google/gemma-2-2b-it everything :) 2025-01-22 12:59:22 +00:00
icae_v2 formatting 2024-12-20 10:18:30 +00:00
scripts faster processing (num_proc + only main preprocess ds) 2025-05-10 17:06:05 +00:00
src/ctx_to_lora webui works with 2 loras (not yet persistent) 2025-05-13 16:44:33 +00:00
webui webui works with 2 loras (not yet persistent) 2025-05-13 16:44:33 +00:00
.gitignore ignore base model eval 2025-02-18 16:11:37 +00:00
.pre-commit-config.yaml init commit 2024-12-18 13:05:19 +00:00
dl_fineweb_edu.py add per rank latent query + per layer hyper head 2025-04-19 07:03:11 +00:00
generate_fw_edu_qa_vllm.py gen script 16k context length 2025-04-28 02:38:29 +00:00
generate_fw_qa.py fw_qa_xl + modernbert 2025-02-14 14:59:25 +00:00
generate_fw_qa_vllm.py add per rank latent query + per layer hyper head 2025-04-19 07:03:11 +00:00
generate_one_big_fw_qa_req.py everything (before us migrate) 2025-01-20 10:31:08 +00:00
generate_qa_parallel.py everything (before us migrate) 2025-01-20 10:31:08 +00:00
generate_qa_parallel_vllm.py fw_qa_xl + modernbert 2025-02-14 14:59:25 +00:00
install.sh install 2025-01-28 21:37:18 +00:00
intx_sft.py webui works with 2 loras (not yet persistent) 2025-05-13 16:44:33 +00:00
post_process_fw_qa.py include new data! 2025-01-13 14:21:41 +00:00
post_process_parallel_qa.py everything (before us migrate) 2025-01-20 10:31:08 +00:00
process_automathtext_arxiv.py include new data! 2025-01-13 14:21:41 +00:00
process_automathtext_code_python.py include new data! 2025-01-13 14:21:41 +00:00
process_automathtext_web.py include new data! 2025-01-13 14:21:41 +00:00
process_codeparrot_qa.py include new data! 2025-01-13 14:21:41 +00:00
process_fineweb.py add per rank latent query + per layer hyper head 2025-04-19 07:03:11 +00:00
process_openphi_prog.py include new data! 2025-01-13 14:21:41 +00:00
pyproject.toml load data from disk then convert to iterable 2025-05-09 13:11:34 +00:00
README.md webui working (not yet two loras) 2025-05-13 10:49:31 +00:00
requirements.txt add per rank latent query + per layer hyper head 2025-04-19 07:03:11 +00:00
run.sh everything (before us migrate) 2025-01-20 10:31:08 +00:00
setup.py restructure 2025-01-17 17:41:10 +00:00
watcher.py restructure 2025-01-17 17:41:10 +00:00

Project doc

Finetuning the base model with LoRA adaptor

WANDB_MODE=disabled python hyperlora/intx_sft.py configs/default.yaml --model_name_or_path=meta-llama/Llama-3.2-1B-Instruct --num_train_epochs=50 --per_device_train_batch_size=128 --per_device_eval_batch_size=128 --exp_setup=lora --train_ds_name=data/raw_datasets/context_numbers_small

HyperLoRA w/ context_numbers_10

WANDB_MODE=disabled run python hyperlora/intx_sft.py configs/context_numbers_10.yaml --model_name_or_path=meta-llama/Llama-3.2-1B-Instruct --num_train_epochs=100 --per_device_train_batch_size=64 --per_device_eval_batch_size=64 --exp_setup=hyper_lora --aggregator_type=perceiver --target_modules=down_proj,up_proj

HyperLoRA w/ context_numbers_128

WANDB_MODE=disabled run python hyperlora/intx_sft.py configs/context_numbers_128.yaml --model_name_or_path=meta-llama/Llama-3.2-1B-Instruct --num_train_epochs=10 --per_device_train_batch_size=64 --per_device_eval_batch_size=8 --exp_setup=hyper_lora --aggregator_type=perceiver --target_modules=down_proj

Generate fineweb qa

# this might take several days...
# python process_fineweb.py
# python generate_fw_qa.py
# python post_process_fw_qa.py
conda activate vllm;
vllm_model=mistralai/Mistral-Small-3.1-24B-Instruct-2503 run python generate_fw_edu_qa_vllm.py "0*_*" 3

GSM8k LoRA

run python intx_sft.py configs/gsm8k.yaml --model_name_or_path=google/gemma-2-2b-it --num_train_epochs=10 --per_device_train_batch_size=16 --gradient_accumulation_steps=1 --per_device_eval_batch_size=32 --exp_setup=lora --target_modules=up_proj,down_proj --eval_steps=5000 --save_steps=5000 --learning_rate=1e-4 --neftune_noise_alpha=5 --load_best_model_at_end=True --metric_for_best_model=gsm8k_loss

Multitask LoRA

run python intx_sft.py configs/math_and_code.yaml --model_name_or_path=google/gemma-2-2b-it --num_train_epochs=1 --per_device_train_batch_size=4 --gradient_accumulation_steps=1 --per_device_eval_batch_size=32 --exp_setup=lora --target_modules=up_proj,down_proj --eval_steps=5000 --save_steps=5000 --learning_rate=2e-5 --neftune_noise_alpha=5 --load_best_model_at_end=True --metric_for_best_model=gsm8k_loss

HyperLoRA finetune on GSM8K

run python intx_sft.py configs/gsm8k.yaml --model_name_or_path=google/gemma-2-2b-it --num_train_epochs=5 --per_device_train_batch_size=16 --gradient_accumulation_steps=1 --per_device_eval_batch_size=8 --exp_setup=hyper_lora --aggregator_type=perceiver --target_modules=down_proj --num_blocks=1 --num_self_attends_per_block=16 --self_attention_widening_factor=1 --eval_steps=5000 --save_steps=5000 --learning_rate=2e-5 --neftune_noise_alpha=5 --use_light_weight_lora=True --light_weight_latent_size=512 --load_best_model_at_end=True --metric_for_best_model=pwc_loss --add_negative_prompt=False --add_repeat_prompt=False --ctx_encoder_model_name_or_path=meta-llama/Llama-3.2-11B-Vision-Instruct

Continue from a checkpoint

run python intx_sft.py configs/...yaml ... --from_pretrained_checkpoint=train_outputs/runs/May09_16-25-35_slurm0-a3nodeset-4_59459_ea85a571/checkpoint-10000/pytorch_model.bin --resume_from_checkpoint=train_outputs/runs/May09_16-25-35_slurm0-a3nodeset-4_59459_ea85a571/checkpoint-10000

Evaluation

LongBench

cd LongBench/LongBench
run python eval_ctx_to_lora.py --model_name Mar16_12-38-01_slurm0-a3nodeset-12_54818_32426662/checkpoint-136782 --checkpoint_path ../../train_outputs/runs/Mar16_12-38-01_slurm0-a3nodeset-12_54818_32426662/checkpoint-136782/pytorch_model.bin