The Constraint Paradox

Constraint in generalized systems leads to highly accurate outputs. OpenAI embraced context grammars, showing the need for structure.

The Constraint Paradox

Generated using Microsoft Designer

Humans are naturally obsessed with amassing knowledge, whether to decrypt the universe via science, obtain political power, or simply for optimization. We’ve embodied these thoughts in superhero(villains) such as Braniac (DC) or The Thinker, and created movies such as Limitless to unlock the full potential of the brain. In the modern era, AI experts are in pursuit of Artificial General Intelligence by training ever-hungry Large Language models on the internet’s plethora of information (sans copyright and other arguments ongoing which is out of scope for this article), yet, in keeping up with the Superhero and unnatural analogies, there always exists a Kryptonite (I’m a DC fan) to “generalized” knowledge. As humans, we find that nearly impossible. Throughout out lives, we seek to specialize, capitalizing on our own strengths and bolstering weaknesses, following our passions, and associating ourselves with what provides purpose in our lives. Generalization is not always the source of power and we are more prone to misinterpret, misrepresent, or blatantly misinform when delving into the nuances of a particular subject matter.

On August 6, 2024, OpenAI stepped back momentarily on the concept of generalized intelligence and peered back into the “Intent Era” of Artificial Intelligence by introducing the concept of Structured Outputs. From the blog (linked moments ago):

Generating structured data from unstructured inputs is one of the core use cases for AI in today’s applications. Developers use the OpenAI API to build powerful assistants that have the ability to fetch data and answer questions via function calling(opens in a new window), extract structured data for data entry, and build multi-step agentic workflows that allow LLMs to take actions. Developers have long been working around the limitations of LLMs in this area via open source tooling, prompting, and retrying requests repeatedly to ensure that model outputs match the formats needed to interoperate with their systems. Structured Outputs solves this problem by constraining OpenAI models to match developer-supplied schemas and by training our models to better understand complicated schemas.

As a practitioner myself in working to translate dialog state languages to help facilitate customer migrations from one AI assistant platform to another, I understand the limitations of zero-shot prompting using an LLM specializing in code generation, heck, even few-shot learning contains limitations. Our team is currently employing agents to decompose and recompose code logic as part of our implementation, illistrating the entire point OpenAI made in the announcement blog. Reading further, OpenAI talks about how this constraint was implemented (Insert suspense):

To do this, we convert the supplied JSON Schema into a context-free grammar (CFG). A grammar is a set of rules that defines a language, and a context-free grammar is a grammar that conforms to specific rules. You can think of JSON and JSON Schema as particular languages with rules to define what is valid within the language. Just as it’s not valid in English to have a sentence with no verb, it is not valid in JSON to have a trailing comma.

Hold on…did OpenAI utter the word “grammar?” Like, in the term “speech grammar?”

Since starting my tenure with Nuance (now Microsoft), I’ve had the privilege of pioneering the transformation of Nuance’s constrained speech recognition engine, Nuance Recognizer. Our 1500+ customers rely heavily on speech grammars to optimize for accuracy, performance (system), and containment within their voice-based applications. As an overview from “‘Recognizing’ the Value of Traditional Speech Systems:

Nuance Recognizer is a speech recognition (f.k.a “speech-to-text”) engine that utilizes constrained vocabularies, called “grammars”, to limit the scope of inbound recognition coming from a human utterance. The grammars, effectively, are a list of words and phrases the speech recognition engine can understand, with any outside deviance unrecognizable. By contrast, traditional speech-to-text engines within the realm of second-generation (“Conversational Intelligence”) engines that employ semantic-based modeling, a supervised machine learning model where audio utterances alongside orthographic (literal) transcriptions are utilized to train the model and provide a “line of best fit” to infer any inbound utterances, able to recognize both what resides within the training set and those outside of its bounds.

Effectively speaking, what a Context Free Grammar (“CFG”) is doing within a Large Language Model is constraining the vocabulary powering the token output of the generative engine and constraining its results to a structured schema for developers to harness. As a reminder, Generative models use similarity search to predict the next set of words to generate based on the input prompt, system prompt, and associated context (“the context window”) and used vector geometry to compute the distance and select the next set of probable words. CFGs, by nature, help limit the output far greater than any p-value or temperature, even few-shot learning could control. In essence, the LLM simply focused on the information it needs to know, not generalized intelligence.

What does OpenAI’s foray into speech grammars indicate? The true power and nature of constraint! Coincidentally, a fellow Medium blogger named Vincent Carchidi authored a beautiful and intellectual stimulating piece entitled “The Constrained Are the Point” where he articulates why constraints (broadly speaking) are more valuable then general intelligence:

So, there is a difference between capability and action that leverages said capability. So far as I can tell, AI research only ever produces systems with capabilities (competencies), not systems that perform stimulus-free, unbounded, yet appropriate actions (performances). Computational models do not act; they do not, in other words, pose Descartes’ problem. They have capabilities that we use, or direct other models to use.
This is evident in the case of LLMs and the chatbots they underpin. First, they are (banally) stimulus-controlled. Second, their linguistic output is potentially infinite and is generated according to a particular structure, namely, the statistical ‘representation’ that the model builds of human-generated text-data (and any other data it is trained on). But its output is not “linguistic” per se as it (1) does not pair sign with meaning but rather sign with sign; and (2) it is reliant on a human to direct its internal resources in the generation of text (tokens, specifically), reinforcing the first point. Third, their text-generation is only appropriate in a functional sense; that is, their entire “idea” of what counts as an “appropriate” remark is tied to their post-training via techniques like Reinforcement Learning from Human Feedback, being in this way controlled by the end-user. They do not use language so much as they generate outputs in response to inputs (not unexpected for a computing device). The entire ‘discourse situation’ of an LLM is established and controlled by programmers and/or end-users, being in this way utterly reliant on internal and external stimuli. LLMs’ “use” of language is a functional relation between internal components and external environment; our human use of language is a relation of appropriateness and correspondence of thought (not necessarily goal-oriented, either).

He further goes to articulate how architectures such as Alpha Geometry 1 and 2 employ constraints (again, not speech grammars specifically but constraints on generalized models) to achieve higher success and learning rate than LLMs.

The broad point behind this article is to articulate that constraints in domain, in language, in understanding, a la specialization in inherently a GOOD thing and there exists a job-to-be-done for each era of Artificial Intelligence. I’d like to remind my readers from an article I authored last week:

The interplay between engines based on the intended functionality is critical to the success of any solution! Simply because one era is in the past does not render it obsolete, rather, builds upon its predecessor. Keep these design decisions in mind when developing conversational and voice based systems within your organization!

Specialized models, specialized data, specialized training, specialized hardware (the list goes on…) all contiribute to highly attuned systems to solve specific problems. With agentic AI paradigms, these models can be interwoven to solve complex issues far more powerful than AGI and far more democratized than a single provider! Constrain our mindset a bit, focus on the now, and build for the future!


Follow me on LinkedIn and continue to support this blog! Thank you!