Skip to content

Commit

Permalink
safety chapter ready for review
Browse files Browse the repository at this point in the history
  • Loading branch information
souzatharsis committed Dec 18, 2024
1 parent 4ee496d commit 65bca1a
Show file tree
Hide file tree
Showing 32 changed files with 6,473 additions and 6,454 deletions.
Binary file modified tamingllms/_build/.doctrees/environment.pickle
Binary file not shown.
Binary file modified tamingllms/_build/.doctrees/markdown/preface.doctree
Binary file not shown.
Binary file modified tamingllms/_build/.doctrees/notebooks/alignment.doctree
Binary file not shown.
Binary file modified tamingllms/_build/.doctrees/notebooks/evals.doctree
Binary file not shown.
Binary file modified tamingllms/_build/.doctrees/notebooks/output_size_limit.doctree
Binary file not shown.
Binary file modified tamingllms/_build/.doctrees/notebooks/safety.doctree
Binary file not shown.
Binary file modified tamingllms/_build/.doctrees/notebooks/structured_output.doctree
Binary file not shown.
Binary file added tamingllms/_build/html/_images/centerai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tamingllms/_build/html/_images/commons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
138 changes: 138 additions & 0 deletions tamingllms/_build/html/_images/design.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,661 changes: 604 additions & 1,057 deletions tamingllms/_build/html/_sources/notebooks/safety.ipynb

Large diffs are not rendered by default.

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.
163 changes: 163 additions & 0 deletions tamingllms/_build/html/_static/safety/design.d2
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Define container for all phases
phases: {
direction: down

# Phase 1: Policy Definition
policy: Phase 1: Policy Definition {
shape: rectangle
style.fill: "#E8F6F3"
style.stroke: "#2ECC71"

input: Input {
shape: cylinder
style.fill: "#FFFFFF"
label: "- Company mission & values\n- Regulatory requirements\n- Industry standards"
}

stakeholders: Stakeholders {
shape: rectangle
style.fill: "#FFFFFF"
label: "- Executive Leadership\n- Legal/Compliance\n- Ethics Committee\n- Security Team"
}

output: Output {
shape: document
style.fill: "#FFFFFF"
label: "- Safety policy\n- Ethical guidelines\n- Compliance checklist"
}
}

# Phase 2: User Research
research: Phase 2: User Research {
shape: rectangle
style.fill: "#FCF3CF"
style.stroke: "#F4D03F"

input: Input {
shape: cylinder
style.fill: "#FFFFFF"
label: "- Safety Policy\n- User research data\n- Business requirements"
}

stakeholders: Stakeholders {
shape: rectangle
style.fill: "#FFFFFF"
label: "- UX Researchers\n- Product Management\n- User Representatives"
}

output: Output {
shape: document
style.fill: "#FFFFFF"
label: "- Risk assessment\n- User requirements\n- UX impact analysis"
}
}

# Phase 3: Evaluation Framework
eval: Phase 3: Evaluation Framework {
shape: rectangle
style.fill: "#EBF5FB"
style.stroke: "#3498DB"

input: Input {
shape: cylinder
style.fill: "#FFFFFF"
label: "- User safety requirements\n- Risk assessment\n- UX impact analysis"
}

stakeholders: Stakeholders {
shape: rectangle
style.fill: "#FFFFFF"
label: "- Product Management\n- Data Scientists\n- Software Engineers"
}

output: Output {
shape: document
style.fill: "#FFFFFF"
label: "- Evals Dataset\n- Target Metrics\n- Benchmark criteria"
}
}

# Phase 4: Architecture Design
arch: Phase 4: Safety Architecture {
shape: rectangle
style.fill: "#F4ECF7"
style.stroke: "#8E44AD"

input: Input {
shape: cylinder
style.fill: "#FFFFFF"
label: "- Business requirements\n- Safety requirements\n- Benchmark criteria"
}

stakeholders: Stakeholders {
shape: rectangle
style.fill: "#FFFFFF"
label: "- Security Architects\n- Engineering Team\n- Operations Team"
}

output: Output {
shape: document
style.fill: "#FFFFFF"
label: "- Architecture diagram\n- Component specs\n- Integration points"
}
}

# Phase 5: Implementation
impl: Phase 5: Implementation {
shape: rectangle
style.fill: "#FADBD8"
style.stroke: "#E74C3C"

input: Input {
shape: cylinder
style.fill: "#FFFFFF"
label: "- Safety architecture\n- Business requirements\n- Benchmark criteria"
}

stakeholders: Stakeholders {
shape: rectangle
style.fill: "#FFFFFF"
label: "- Engineering Team\n- Product Management"
}

output: Output {
shape: document
style.fill: "#FFFFFF"
label: "- Safety system\n- Integration docs\n- Maintenance plans"
}
}

# Phase 6: Go-to-Market
gtm: Phase 6: Go-to-Market {
shape: rectangle
style.fill: "#D5F5E3"
style.stroke: "#27AE60"

input: Input {
shape: cylinder
style.fill: "#FFFFFF"
label: "- Monitoring requirements\n- Incident response plan\n- User feedback"
}

stakeholders: Stakeholders {
shape: rectangle
style.fill: "#FFFFFF"
label: "- Operations Team\n- Engineering Team\n- Support Team"
}

output: Output {
shape: document
style.fill: "#FFFFFF"
label: "- Monitoring system\n- Response procedures\n- Performance dashboards"
}
}

# Phase connections
policy -> research
research -> eval
eval -> arch
arch -> impl
impl -> gtm
}

direction: down
138 changes: 138 additions & 0 deletions tamingllms/_build/html/_static/safety/design.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions tamingllms/_build/html/markdown/preface.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ <h1><span class="section-number">1. </span>Preface<a class="headerlink" href="#p
<div><p>Models tell you merely what something is like, not what something is.</p>
<p class="attribution">—Emanuel Derman</p>
</div></blockquote>
<p>An alternative title of this book could have been “Language Models Behaving Badly”. If you are coming from a background in financial modeling, you may have noticed the parallel with Emanuel Derman’s seminal work “Models.Behaving.Badly” <span id="id1">[<a class="reference internal" href="#id117" title="E. Derman. Models.Behaving.Badly.: Why Confusing Illusion with Reality Can Lead to Disaster, on Wall Street and in Life. Free Press, 2011. ISBN 9781439165010. URL: https://books.google.co.uk/books?id=lke_cwM4wm8C.">Derman, 2011</a>]</span>. This parallel is not coincidental. Just as Derman cautioned against treating financial models as perfect representations of reality, this book aims to highlight the limitations and pitfalls of Large Language Models (LLMs) in practical applications (of course baring the fact Derman is an actual physicist and legendary author, professor and quant; I am not).</p>
<p>An alternative title of this book could have been “Language Models Behaving Badly”. If you are coming from a background in financial modeling, you may have noticed the parallel with Emanuel Derman’s seminal work “Models.Behaving.Badly” <span id="id1">[<a class="reference internal" href="#id118" title="E. Derman. Models.Behaving.Badly.: Why Confusing Illusion with Reality Can Lead to Disaster, on Wall Street and in Life. Free Press, 2011. ISBN 9781439165010. URL: https://books.google.co.uk/books?id=lke_cwM4wm8C.">Derman, 2011</a>]</span>. This parallel is not coincidental. Just as Derman cautioned against treating financial models as perfect representations of reality, this book aims to highlight the limitations and pitfalls of Large Language Models (LLMs) in practical applications (of course baring the fact Derman is an actual physicist and legendary author, professor and quant; I am not).</p>
<p>The book “Models.Behaving.Badly” by Emanuel Derman, a former physicist and Goldman Sachs quant, explores how financial and scientific models can fail when we mistake them for reality rather than treating them as approximations full of assumptions.
The core premise of his work is that while models can be useful tools for understanding aspects of the world, they inherently involve simplification and assumptions. Derman argues that many financial crises, including the 2008 crash, occurred partly because people put too much faith in mathematical models without recognizing their limitations.</p>
<p>Like financial models that failed to capture the complexity of human behavior and market dynamics, LLMs have inherent constraints. They can hallucinate facts, struggle with logical reasoning, and fail to maintain consistency across long outputs. Their responses, while often convincing, are probabilistic approximations based on training data rather than true understanding even though humans insist on treating them as “machines that can reason”.</p>
Expand All @@ -224,7 +224,7 @@ <h1><span class="section-number">1. </span>Preface<a class="headerlink" href="#p
<section id="references">
<h2><span class="section-number">1.1. </span>References<a class="headerlink" href="#references" title="Permalink to this heading"></a></h2>
<div class="docutils container" id="id2">
<div class="citation" id="id117" role="doc-biblioentry">
<div class="citation" id="id118" role="doc-biblioentry">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id1">Der11</a><span class="fn-bracket">]</span></span>
<p>E. Derman. <em>Models.Behaving.Badly.: Why Confusing Illusion with Reality Can Lead to Disaster, on Wall Street and in Life</em>. Free Press, 2011. ISBN 9781439165010. URL: <a class="reference external" href="https://books.google.co.uk/books?id=lke_cwM4wm8C">https://books.google.co.uk/books?id=lke_cwM4wm8C</a>.</p>
</div>
Expand Down
Loading

0 comments on commit 65bca1a

Please sign in to comment.