~/talk

Safer Code with LLMs: Scala Types Silver Bullet?

Talkat Scalar 2026 · 2026-03-26..03-27· [large-language-models, security, scala]
slides:none on file

Claim: invoking Scala type system features in prompts makes LLM-generated code measurably safer. Methods: prompt experiments with open models (Llama 70B, Code Llama, Qwen, Gemma), verification via Stainless verifier, attention-map probing and tests derived from a 2021 vulnerability paper. Results: models show reduced safety issues but not perfect functional correctness; attention maps show type tokens drive real code changes while generic “safe” words do not. Prototype TypePilot generates well-typed Scala that, when it compiles, is usually secure for most models.

AI-written summary · about

  1. 0:00Introduction
  2. 1:47ML basics for functional programmers
  3. 6:16LLM limits in mainstream languages
  4. 9:25Security risks and hallucinations
  5. 13:18Human cost of unsafe AI coding
  6. 15:05Formal verification as safety
  7. 17:06Testing LLMs with Stainless
  8. 18:37Scala types for safer code
  9. 21:27Introducing TypePilot
  10. 23:35Debugging open vs closed models
  11. 25:21Agentic AI rise and risks
  12. 28:54Why Scala for safer agentic code
  13. 32:07Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.