Back to blog
Articles
Articles
September 20, 2023
·
4 min read

Language Model Cascading & Probabilistic Programming Language

September 20, 2023
|
4 min read

Latest content

Customer Stories
4min read

Lightspeed Uses HumanFirst for In-House AI Enablement

Meet Caroline, an analyst-turned-AI-expert who replaced manual QA, saved countless managerial hours, and built new solutions for customer support.
December 10, 2024
Customer Stories
4 min read

How Infobip Generated 220+ Knowledge Articles with Gen AI For Smarter Self-Service and Better NPS

Partnering with HumanFirst, Infobip generated over 220 knowledge articles, unlocked 30% of their agents' time, and improved containment by a projected 15%.
September 16, 2024
Articles
7 min read

Non-Technical AI Adoption: The Value of & Path Towards Workforce-Wide AI

Reviewing the state of employee experimentation and organizational adoption, and exploring the shifts in thinking, tooling, and training required for workforce-wide AI.
September 12, 2024
Articles
6 min read

AI for CIOs: From One-Off Use to Company-Wide Value

A maturity model for three stages of AI adoption, including strategies for company leaders to progress to the next stage.
September 12, 2024
Tutorials
4 min read

Building Prompts for Generators in Dialogflow CX

How to get started with generative features.
August 15, 2024
Announcements
3 min read

HumanFirst and Infobip Announce a Partnership to Equip Enterprise Teams with Data + Generative AI

With a one-click integration to Conversations, Infobip’s contact center solution, HumanFirst helps enterprise teams leverage LLMs to analyze 100% of their customer data.
August 8, 2024
Tutorials
4 min read

Two Field-Tested Prompts for CX Teams

Get deeper insights from unstructured customer data with generative AI.
August 7, 2024
Tutorials
5 min read

Optimizing RAG with Knowledge Base Maintenance

How to find gaps between knowledge base content and real user questions.
April 23, 2024
Customer Stories
4min read

Lightspeed Uses HumanFirst for In-House AI Enablement

Meet Caroline, an analyst-turned-AI-expert who replaced manual QA, saved countless managerial hours, and built new solutions for customer support.
December 10, 2024
Customer Stories
4 min read

How Infobip Generated 220+ Knowledge Articles with Gen AI For Smarter Self-Service and Better NPS

Partnering with HumanFirst, Infobip generated over 220 knowledge articles, unlocked 30% of their agents' time, and improved containment by a projected 15%.
September 16, 2024
Articles
7 min read

Non-Technical AI Adoption: The Value of & Path Towards Workforce-Wide AI

Reviewing the state of employee experimentation and organizational adoption, and exploring the shifts in thinking, tooling, and training required for workforce-wide AI.
September 12, 2024

Let your data drive.

Articles

Language Model Cascading & Probabilistic Programming Language

COBUS GREYLING
September 20, 2023
.
4 min read

The term Language Model Cascading (LMC) was coined in July 2022, which seems like a lifetime ago considering the speed at which the LLM narrative arc develops…

Introduction

This is one of the most interesting papers I have read in a long time, the fact that it is just over a year old make it seem quite recent. However, reading the paper, one realises the speed at which technology has progressed in just over twelve months.

Considering the paper, the Scratchpad and Chain-Of-Thought approach are two of the most recognised approaches in recent times. The Tool Usedescription is very close to what we know today as autonomous agents. Selection-Inference is a basic description of RAG. And Verifiers really reminds of the recent test framework developed by Ragas.

In this study of July 2022 the phrase cascading is used as an analogous term for chaining. In later studies cascading has adopted a different meaning. Read more about it here.

The way descriptive terms are used in this paper, as opposed to the now well-known terms is interesting, and it is quite insightful how these ideas developed into real implementations.

It’s interesting how the early vulnerabilities and opportunities were identified and developments on a few fronts, brought solutions to production.

Developments took place in the area of LLMs, Prompt Engineering Techniques, Prompt Injection/enrichment at inference, Autonomous Agents and Prompt Chaining IDEs.

Back To The Paper…

The term LMC was developed to act as a reference framework for computer programs that chain together LLM interactions, a probabilistic programming language (PPL). A framework for creating computer programs that chain together language model interactions.

Even-though this study is old in relative terms, valuable principles can be gleaned from it, and it acts as a history lesson in how we find ourselves with the current tools at our disposal.

Source

Scratchpads & CoT

I like the way this paper words CoT and Scratchpads: Inference can be implemented by ancestral sampling. Both Scratchpads and CoT shows intermediate computation.

Tool Use

Tool use reminds strongly of what we now know as autonomous agents.

The other applications discussed so far involve iterating a language model within a controlled flow, without external feedback. The paper argues that there are many tasks of interest in which a model is interacting with external systems.

Examples of external tools are a calculator to solve math problems. Or a tool which can perform web browsing and perform QnA.

Verifiers

An intuitive way to improve model performance is to train it to judge whether an answer and thought are likely to be “valid”. Cobbe et al. (2021) propose using a separate model as a verifier to filter solutions to reasoning tasks.

The Verifiers approach can be described as where a verification label (V) is added to show whether the thought (T) is a valid form of reasoning for deriving (A) from (Q) and (A) is the correct answer.

D = {(Q, T, A, V}

We can create a “labeled” training set of the form D, where we add a “verification” label V, representing whether the thought T is a valid form of reasoning for deriving A from Q, and A is the correct answer.

The verifiers may be used to reject incorrect examples in ancestral sampling, and the thought generator may itself be conditioned on the verifiers being correct by fine-tuning or prompting.

This approach reminds quite a bit of the Ragas approach of having a ground truthed reference.

Practically it will work best if only a sample of data is submitted to the Verifiers process for testing.

Selection-Inference

In this paper Selection-Inference is considered as a chain. Considering the image below, the S is the selected subset of facts and I is an inference driven by this subset.

Source

This approach is very reminiscent of the retrieval-augmented generation (RAG) as we know and understand it today.

Probabilistic Programming Language (PPL)

Probabilistic Programs (PPLs) are constituted by two constructs:

  1. PPLs have the ability to draw values at random from distributions.
  2. The ability to condition values of variables in a program via observations.

What makes Probabilistic Programs different from traditional programming languages, is the fact that they have the ability to sample from distributions and observe variables based on data.

Hence we can make predictions based on certain inputs and/or outputs of a program. For example, we can sample prompts conditioned on the output of a verifier or external tool.

Chaining was thought of as unique in providing a probabilistic programming framework over the space of strings.

Language models take in and emit text written in a human language. Chaining allows for various kinds of conditional and unconditional inference over this space.

Google Research’s cascades implementation notebook.

I’m currently the Chief Evangelist @ HumanFirst. I explore & write about all things at the intersection of AI & language; ranging from LLMs, Chatbots, Voicebots, Development Frameworks, Data-Centric latent spaces & more.

Subscribe to HumanFirst Blog

Get the latest posts delivered right to your inbox