-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finish alignment case study. Ready for review.
- Loading branch information
souzatharsis
committed
Dec 14, 2024
1 parent
657c9f1
commit 808a8a7
Showing
33 changed files
with
2,789 additions
and
3,035 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+871 Bytes
(100%)
tamingllms/_build/.doctrees/notebooks/output_size_limit.doctree
Binary file not shown.
Binary file modified
BIN
+871 Bytes
(100%)
tamingllms/_build/.doctrees/notebooks/structured_output.doctree
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,197 changes: 455 additions & 742 deletions
1,197
tamingllms/_build/html/_sources/notebooks/alignment.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
direction: right | ||
|
||
# Response Generation in middle | ||
generation: Response Generation { | ||
direction: right | ||
shape: rectangle | ||
style.fill: "#FCF3CF" | ||
style.stroke: "#F4D03F" | ||
|
||
input: Models { | ||
shape: rectangle | ||
style.fill: "#FFFFFF" | ||
|
||
base: Base LLM | ||
aligned: Aligned LLM | ||
} | ||
|
||
task: Task { | ||
shape: rectangle | ||
style.fill: "#FFFFFF" | ||
label: "Generate responses\nfor each prompt" | ||
} | ||
|
||
output: Output { | ||
shape: document | ||
style.fill: "#FFFFFF" | ||
label: "Paired responses" | ||
} | ||
|
||
input.base -> task | ||
input.aligned -> task | ||
task -> output | ||
} | ||
|
||
# LLM Judge Scoring at bottom | ||
scoring: LLM Judge Scoring { | ||
direction: right | ||
shape: rectangle | ||
style.fill: "#EBF5FB" | ||
style.stroke: "#3498DB" | ||
|
||
scale: Safety Scale { | ||
shape: rectangle | ||
style.fill: "#FFFFFF" | ||
label: "0.1: Inappropriate\n0.5: Somewhat aligned\n1.0: Fully aligned" | ||
} | ||
|
||
task: Task { | ||
shape: rectangle | ||
style.fill: "#FFFFFF" | ||
label: "Evaluate responses" | ||
} | ||
|
||
output: Output { | ||
shape: cylinder | ||
style.fill: "#FFFFFF" | ||
label: "Safety scores database" | ||
} | ||
|
||
scale -> task -> output | ||
} | ||
|
||
# Success criteria at very bottom | ||
success: Success Criteria { | ||
shape: page | ||
style.fill: "#F5EEF8" | ||
style.stroke: "#8E44AD" | ||
label: "Compare score distributions\nAligned model should show\nhigher safety scores" | ||
} | ||
|
||
# Start with Evaluation Dataset at top | ||
dataset: Evaluation Dataset { | ||
direction: right | ||
shape: rectangle | ||
style.fill: "#E8F6F3" | ||
style.stroke: "#2ECC71" | ||
|
||
input: DPO Dataset { | ||
shape: cylinder | ||
style.fill: "#FFFFFF" | ||
label: "User prompts that\ncould violate policy" | ||
} | ||
|
||
task: Task { | ||
shape: rectangle | ||
style.fill: "#FFFFFF" | ||
label: "Sample n entries" | ||
} | ||
|
||
output: Output { | ||
shape: document | ||
style.fill: "#FFFFFF" | ||
label: "n evaluation prompts" | ||
} | ||
|
||
input -> task -> output | ||
} | ||
|
||
scoring.output -> success: Analyze | ||
generation.output -> scoring.task: Responses | ||
dataset.output -> generation.task: Prompts |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Data Inputs | ||
data: Data Inputs { | ||
shape: rectangle | ||
style.fill: "#E8F6F3" | ||
style.stroke: "#2ECC71" | ||
direction: right | ||
|
||
binary: ultrafeedback_binarized { | ||
shape: cylinder | ||
style.fill: "#FFFFFF" | ||
} | ||
|
||
policy: policy_aligned { | ||
shape: cylinder | ||
style.fill: "#FFFFFF" | ||
} | ||
} | ||
|
||
# Model Input | ||
model: Model Input { | ||
shape: rectangle | ||
style.fill: "#FCF3CF" | ||
style.stroke: "#F4D03F" | ||
|
||
base: SmolLM2-360M-Instruct { | ||
shape: rectangle | ||
style.fill: "#FFFFFF" | ||
label: "SmolLM2-360M-Instruct" | ||
} | ||
} | ||
|
||
# DPO Optimization | ||
dpo: DPO Optimization { | ||
shape: rectangle | ||
style.fill: "#EBF5FB" | ||
style.stroke: "#3498DB" | ||
} | ||
|
||
# Output Model | ||
output: smolK-12 { | ||
shape: rectangle | ||
style.fill: "#F5EEF8" | ||
style.stroke: "#8E44AD" | ||
label: "SmolK-12 (Aligned Model)" | ||
} | ||
|
||
# Connections | ||
data -> dpo | ||
model -> dpo | ||
dpo -> output | ||
|
||
direction: down |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.