Podbean logo
  • Discover
  • Podcast Features
    • Podcast Hosting

      Start your podcast with all the features you need.

    • Podbean AI Podbean AI

      AI-Enhanced Audio Quality and Content Generation.

    • Blog to Podcast

      Repurpose your blog into an engaging podcast.

    • Video to Podcast

      Convert YouTube playlists to podcasts, videos to audios.

  • Monetization
    • Ads Marketplace

      Join Ads Marketplace to earn through podcast sponsorships.

    • PodAds

      Manage your ads with dynamic ad insertion capability.

    • Apple Podcasts Subscriptions Integration

      Monetize with Apple Podcasts Subscriptions via Podbean.

    • Live Streaming

      Earn rewards and recurring income from Fan Club membership.

  • Podbean App
    • Podcast Studio

      Easy-to-use audio recorder app.

    • Podcast App

      The best podcast player & podcast app.

  • Help and Support
    • Help Center

      Get the answers and support you need.

    • Podbean Academy

      Resources and guides to launch, grow, and monetize podcast.

    • Podbean Blog

      Stay updated with the latest podcasting tips and trends.

    • What’s New

      Check out our newest and recently released features!

    • Podcasting Smarter

      Podcast interviews, best practices, and helpful tips.

  • Popular Topics
    • How to Start a Podcast

      The step-by-step guide to start your own podcast.

    • How to Start a Live Podcast

      Create the best live podcast and engage your audience.

    • How to Monetize a Podcast

      Tips on making the decision to monetize your podcast.

    • How to Promote Your Podcast

      The best ways to get more eyes and ears on your podcast.

    • Podcast Advertising 101

      Everything you need to know about podcast advertising.

    • Mobile Podcast Recording Guide

      The ultimate guide to recording a podcast on your phone.

    • How to Use Group Recording

      Steps to set up and use group recording in the Podbean app.

  • All Arts Business Comedy Education
  • Fiction Government Health & Fitness History Kids & Family
  • Leisure Music News Religion & Spirituality Science
  • Society & Culture Sports Technology True Crime TV & Film
  • Live
  • How to Start a Podcast
  • How to Start a Live Podcast
  • How to Monetize a podcast
  • How to Promote Your Podcast
  • How to Use Group Recording
  • Log in
  • Start your podcast for free
  • Podcasting
    • Podcast Features
      • Podcast Hosting

        Start your podcast with all the features you need.

      • Podbean AI Podbean AI

        AI-Enhanced Audio Quality and Content Generation.

      • Blog to Podcast

        Repurpose your blog into an engaging podcast.

      • Video to Podcast

        Convert YouTube playlists to podcasts, videos to audios.

    • Monetization
      • Ads Marketplace

        Join Ads Marketplace to earn through podcast sponsorships.

      • PodAds

        Manage your ads with dynamic ad insertion capability.

      • Apple Podcasts Subscriptions Integration

        Monetize with Apple Podcasts Subscriptions via Podbean.

      • Live Streaming

        Earn rewards and recurring income from Fan Club membership.

    • Podbean App
      • Podcast Studio

        Easy-to-use audio recorder app.

      • Podcast App

        The best podcast player & podcast app.

  • Advertisers
  • Enterprise
  • Pricing
  • Resources
    • Help and Support
      • Help Center

        Get the answers and support you need.

      • Podbean Academy

        Resources and guides to launch, grow, and monetize podcast.

      • Podbean Blog

        Stay updated with the latest podcasting tips and trends.

      • What’s New

        Check out our newest and recently released features!

      • Podcasting Smarter

        Podcast interviews, best practices, and helpful tips.

    • Popular Topics
      • How to Start a Podcast

        The step-by-step guide to start your own podcast.

      • How to Start a Live Podcast

        Create the best live podcast and engage your audience.

      • How to Monetize a Podcast

        Tips on making the decision to monetize your podcast.

      • How to Promote Your Podcast

        The best ways to get more eyes and ears on your podcast.

      • Podcast Advertising 101

        Everything you need to know about podcast advertising.

      • Mobile Podcast Recording Guide

        The ultimate guide to recording a podcast on your phone.

      • How to Use Group Recording

        Steps to set up and use group recording in the Podbean app.

  • Discover
  • Log in
    Sign up free
The Real Python Podcast

The Real Python Podcast

Technology

Measuring Bias, Toxicity, and Truthfulness in LLMs With Python

Measuring Bias, Toxicity, and Truthfulness in LLMs With Python

2024-01-19
Download Right click and do "save link as"

How can you measure the quality of a large language model? What tools can measure bias, toxicity, and truthfulness levels in a model using Python? This week on the show, Jodie Burchell, developer advocate for data science at JetBrains, returns to discuss techniques and tools for evaluating LLMs With Python.

Jodie provides some background on large language models and how they can absorb vast amounts of information about the relationship between words using a type of neural network called a transformer. We discuss training datasets and the potential quality issues with crawling uncurated sources.

We dig into ways to measure levels of bias, toxicity, and hallucinations using Python. Jodie shares three benchmarking datasets and links to resources to get you started. We also discuss ways to augment models using agents or plugins, which can access search engine results or other authoritative sources.

This week’s episode is brought to you by Intel.

Course Spotlight: Learn Text Classification With Python and Keras

In this course, you’ll learn about Python text classification with Keras, working your way from a bag-of-words model with logistic regression to more advanced methods, such as convolutional neural networks. You’ll see how you can use pretrained word embeddings, and you’ll squeeze more performance out of your model through hyperparameter optimization.

Topics:

  • 00:00:00 – Introduction
  • 00:02:19 – Testing characteristics of LLMs with Python
  • 00:04:18 – Background on LLMs
  • 00:08:35 – Training of models
  • 00:14:23 – Uncurated sources of training
  • 00:16:12 – Safeguards and prompt engineering
  • 00:21:19 – TruthfulQA and creating a more strict prompt
  • 00:23:20 – Information that is out of date
  • 00:26:07 – WinoBias for evaluating gender stereotypes
  • 00:28:30 – BOLD dataset for evaluating bias
  • 00:30:28 – Sponsor: Intel
  • 00:31:18 – Using Hugging Face to start testing with Python
  • 00:35:25 – Using the transformers package
  • 00:37:34 – Using langchain for proprietary models
  • 00:43:04 – Putting the tools together and evaluating
  • 00:47:19 – Video Course Spotlight
  • 00:48:29 – Assessing toxicity
  • 00:50:21 – Measuring bias
  • 00:54:40 – Checking the hallucination rate
  • 00:56:22 – LLM leaderboards
  • 00:58:17 – What helped ChatGPT leap forward?
  • 01:06:01 – Improvements of what is being crawled
  • 01:07:32 – Revisiting agents and RAG
  • 01:11:03 – ChatGPT plugins and Wolfram-Alpha
  • 01:13:06 – How can people follow your work online?
  • 01:14:33 – Thanks and goodbye

Background Links:

  • A Beginner’s Guide to Language Models - Built In
  • ChatGPT - Explained! - YouTube

Dataset Links:

  • truthful_qa - Datasets at Hugging Face
  • wino_bias - Datasets at Hugging Face
  • bold - Datasets at Hugging Face

Tutorials and Documentation for Python Packages:

  • Evaluating Language Model Bias with 🤗 Evaluate
  • Hugging Face - HF_bias_evaluation - Google Colab
  • General Usage - Load a Dataset - Hugging Face
  • What is Text Generation? - Hugging Face
  • 🤗 Evaluate - Library Evaluating ML Models
  • Python Quickstart - 🦜️🔗 Langchain

Measurement Links:

  • Toxicity - a Hugging Face Space by evaluate-measurement
  • Regard - a Hugging Face Space by evaluate-measurement
  • Open LLM Leaderboard - a Hugging Face Space

Training Data for LLMs:

  • Common Crawl - Open Repository of Web Crawl Data
  • The Pile
  • The RefinedWeb Dataset for Falcon LLM: Outperforming Curated Corpora

Agents and Plugin Links:

  • Transformers Agents - Hugging Face
  • Agents - 🦜️🔗 Langchain
  • ChatGPT Gets Its “Wolfram Superpowers”! - Stephen Wolfram

Additional Links:

  • Inside the AI Factory: The Humans that Make Tech Seem Human - The Verge
  • Jodie Burchell - The JetBrains Blog
  • Jodie Burchell’s Blog - Standard error
  • Jodie Burchell 🇦🇺🇩🇪 (@t_redactyl) - Twitter
  • Jodie Burchell 🇦🇺🇩🇪 (@t_redactyl@fosstodon.org) - Fosstodon
  • JetBrains: Essential tools for software developers and teams

Level up your Python skills with our expert-led courses:

  • Data Cleaning With pandas and NumPy
  • Creating Web Maps From Your Data With Python Folium
  • Learn Text Classification With Python and Keras

Support the podcast & join our community of Pythonistas

view more

More Episodes

Solving Problems and Saving Time in Chemistry With Python
2025-07-04
Structuring Python Scripts & Exciting Non-LLM Software Trends
2025-06-27
Scaling Python Web Applications With Kubernetes and Karpenter
2025-06-20
Starting With marimo Notebooks & Python App Config Management
2025-06-13
Rodrigo Girão Serrão: Python Training, itertools, and Idioms
2025-06-06
Python Thread Safety & Managing Projects With uv
2025-05-30
DjangoCon Europe 2025: Live Recording From Dublin
2025-05-23
Going Beyond requirements.txt With pylock.toml and PEP 751
2025-05-16
Experiments With Gen AI, Knowledge Graphs, Workflows, and Python
2025-05-09
Exploring DuckDB & Comparing Python Expressions vs Statements
2025-04-18
Learning Intermediate Python With a Deep Dive Course
2025-04-11
GUIs & TUIs: Choosing a User Interface for Your Python Project
2025-04-04
A Decade of Automating the Boring Stuff With Python
2025-03-21
Manage Projects With pyproject.toml & Explore Polars LazyFrames
2025-03-14
Eric Matthes: Maybe Don't Start With Unit Tests
2025-03-07
Deciphering Python Jargon & Compiling Python 1.0
2025-02-28
Telling Effective Stories With Your Python Visualizations
2025-02-21
Behavior-Driven vs Test-Driven Development & Using Regex in Python
2025-02-14
Charlie Marsh: Accelerating Python Tooling With Ruff and uv
2025-02-07
Testing Your Python Code Base: Unit vs. Integration
2025-01-31
  • ←
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • →
012345678910111213141516171819

Get this podcast on your
phone, FREE

Download Podbean app on App Store Download Podbean app on Google Play

Create your
podcast in
minutes

  • Full-featured podcast site
  • Unlimited storage and bandwidth
  • Comprehensive podcast stats
  • Distribute to Apple Podcasts, Spotify, and more
  • Make money with your podcast
Get started

It is Free

  • Podcast Services

    • Podcast Features
    • Pricing
    • Enterprise Solution
    • Private Podcast
    • The Podcast App
    • Live Stream
    • Audio Recorder
    • Remote Recording
    • Podbean AI
  •  
    • Create a Podcast
    • Video Podcast
    • Start Podcasting
    • Start Radio Talk Show
    • Education Podcast
    • Church Podcast
    • Nonprofit Podcast
    • Get Sermons Online
    • Free Audiobooks
  • MONETIZATION & MORE

    • Podcast Advertising
    • Dynamic Ads Insertion
    • Apple Podcasts Subscriptions
    • Switch to Podbean
    • YouTube to Podcast
    • Blog to Podcast
    • Submit Your Podcast
    • Podbean Plugins
    • Developers
  • KNOWLEDGE BASE

    • How to Start a Podcast
    • How to Start a Live Podcast
    • How to Monetize a Podcast
    • How to Promote Your Podcast
    • Mobile Podcast Recording Guide
    • How to Use Group Recording
    • Podcast Advertising 101
  • Support

    • Support Center
    • What’s New
    • Free Webinars
    • Podcast Events
    • Podbean Academy
    • Podbean Amplified Podcast
    • Badges
    • Resources
  • Podbean

    • About Us
    • Podbean Blog
    • Careers
    • Press and Media
    • Green Initiative
    • Affiliate Program
    • Contact Us
  • Privacy Policy
  • Cookie Policy
  • Terms of Use
  • Consent Preferences
  • Copyright © 2015-2025 Podbean.com