8000 GitHub - xzAscC/ProbingReflection: Source Code of paper "From Emergence to Control: Probing and Modulating Self-Reflection in Language Models"
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Source Code of paper "From Emergence to Control: Probing and Modulating Self-Reflection in Language Models"

License

Notifications You must be signed in to change notification settings

xzAscC/ProbingReflection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProbingReflection

Source Code of paper "From Emergence to Control: P 6E44 robing and Modulating Self-Reflection in Language Models"

Requirement

  • transformers
  • datasets
  • vllm
  • latex2sympy2_extended
  • pylatexenc
  • umap-learn

Folder Architecture

src: source code
    acc_length_rel.py: explore the relationship between length and acc
    math_grader.py: evaluation the math problem
    inference.py: inference with original model and inserted model
    save_insert_model.py: use vector to do insertion
    utils.py: other functions
asset: folder to save responses
models: folder to save model weights
scripts: bash file to inference

Getting Started

Running Inference

To run inference with the original model:

python src/inference.py --model [MODEL_NAME] --output_dir [OUTPUT_PATH]

To run inference with the inserted model:

python src/inference.py --model [MODEL_NAME] --injection  --injection_layer [INJECTION_LAYER]  --injection_alpha [INJECTION_ALPHA] --output_dir [OUTPUT_PATH]

Model Insertion

To insert vectors into a model:

python src/save_insert_model.py --model [MODEL_NAME] --output_dir [OUTPUT_DIR]

For more details, refer to the scripts in the scripts directory.

About

Source Code of paper "From Emergence to Control: Probing and Modulating Self-Reflection in Language Models"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0