Skip to content

Claude/review project code 01 gyhv s8 wg ve gu1u y1 pz9 sos#21

Open
joshbox3 wants to merge 4 commits intoYu-Fangxu:mainfrom
joshbox3:claude/review-project-code-01GyhvS8WGVeGu1uY1Pz9Sos
Open

Claude/review project code 01 gyhv s8 wg ve gu1u y1 pz9 sos#21
joshbox3 wants to merge 4 commits intoYu-Fangxu:mainfrom
joshbox3:claude/review-project-code-01GyhvS8WGVeGu1uY1Pz9Sos

Conversation

@joshbox3
Copy link
Copy Markdown

@joshbox3 joshbox3 commented Dec 7, 2025

Leaned up the code

claude and others added 4 commits December 7, 2025 10:06
Contains:
- Jupyter notebook for A100 GPU execution (SPSA gradient-free approach)
- GPT-4 selection module for multi-sample attack selection
- Visualization tools for publication-quality plots
- Team documentation (Battle Plan, Team Guide)
- Presentation materials
Changes:
- Renamed notebook to cold_attack_replication.ipynb
- Simplified documentation (project_notes.md, team_guide.md, presentation_notes.md)
- Simplified Python files (gpt4_eval.py, plot_results.py)
- Removed overly complex files (diagrams, JSX component)
- Made all docs more casual/student-like
Replace SPSA gradient-free approach with real backpropagation:
- Add epsilon = nn.Parameter optimized with Adam optimizer
- Remove torch.no_grad() from soft_forward and soft_forward_xyz
- Gradients flow through: epsilon -> softmax -> embedding -> model
- Properly implement Langevin dynamics with gradient descent + noise

Key changes:
- util.py: Real gradient flow through embed_inputs and soft_forward
- decoding_suffix.py: Use loss.backward() and optim.step()
- Removed duplicate util.py cell (was written twice)
- Cleaned up all cells to be student-style without emojis

This should significantly improve ASR compared to SPSA version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants