An experiment script that gradually shifts generation from normal next-token prediction toward a worst-token style distribution, while tracking entropy growth and text collapse behavior.
worst_generator.py: main experiment script
- Python 3.10+ (recommended)
- Optional but recommended: CUDA GPU
Install dependencies:
pip install torch transformers matplotlib numpypython worst_generator.pyThe script will:
- load
IDEA-CCNL/Wenzhong-GPT2-110M - generate text with gradual collapse scheduling
- print generated text
- save
entropy_curve.png
In worst_generator.py, adjust these variables:
prompt: initial prompt texttarget_total_tokens,min_new_tokens: output length controlalpha_start,alpha_max: collapse strength rangecollapse_warmup_ratio,collapse_reach_alpha_max_ratio,collapse_curve_power: collapse speed/schedulerepeat_penalty_start,repeat_penalty_base,repeat_hard_block_start: repeated-character suppression
- First run may take longer because model weights are downloaded.
- Behavior is intentionally unstable in later steps (semantic drift, gibberish, symbol noise).