Skip to content

Commit

Permalink
add safety case study
Browse files Browse the repository at this point in the history
  • Loading branch information
souzatharsis committed Dec 18, 2024
1 parent f979737 commit 53a9400
Show file tree
Hide file tree
Showing 29 changed files with 14,132 additions and 771 deletions.
722 changes: 588 additions & 134 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ license = "Attribution-NonCommercial-ShareAlike 4.0 International"
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.11"
python = ">=3.11,<3.13"
jupyter-book = "^1.0.3"
pandas = "^2.2.3"
openai = "^1.54.4"
ipykernel = "^6.29.5"
python-dotenv = "^1.0.1"
requests = "^2.32.3"
beautifulsoup4 = "^4.12.3"
tiktoken = "^0.8.0"
tiktoken = ">=0.5,<0.8"
litellm = "^1.52.9"
pydata-sphinx-theme = "^0.16.0"
sphinx-multitoc-numbering = "^0.1.3"
Expand All @@ -38,6 +38,10 @@ ollama = "^0.4.3"
langsmith = "0.2.0"
sphinxcontrib-mermaid = "^1.0.0"
seaborn = "^0.13.2"
ipywidgets = "^8.1.5"
mistralai = "^1.2.5"
llm-guard = "^0.3.15"
pygments = "^2.18.0"


[build-system]
Expand Down
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.
2 changes: 1 addition & 1 deletion tamingllms/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 0674df45a82890a4968a11e155ae506b
config: 188f476ff603503d272f0faa368442ae
tags: 645f666f9bcd5a90fca523b33c5a78b7
1,267 changes: 1,223 additions & 44 deletions tamingllms/_build/html/_sources/notebooks/safety.ipynb

Large diffs are not rendered by default.

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="#id116" 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="#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>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="id116" role="doc-biblioentry">
<div class="citation" id="id117" 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 53a9400

Please sign in to comment.