What is Retrieval Augmented Generation?

Large Language Models (LLMs) have contributed to advancing the domain of natural language processing (NLP), yet an existing gap persists in contextual understanding. LLMs can sometimes produce inaccurate or unreliable responses, a phenomenon known as “hallucinations.”  For instance, with ChatGPT, the occurrence of hallucinations is approximated…

Complex, unfamiliar sentences make the brain’s language network work harder

With help from an artificial language network, MIT neuroscientists have discovered what kind of sentences are most likely to fire up the brain’s key language processing centers.

The new study reveals that sentences that are more complex, either because of unusual grammar or unexpected meaning, generate stronger responses in these language processing centers. Sentences that are very straightforward barely engage these regions, and nonsensical sequences of words don’t do much for them either.

For example, the researchers found this brain network was most active when reading unusual sentences such as “Buy sell signals remains a particular,” taken from a publicly available language dataset called C4. However, it went quiet when reading something very straightforward, such as “We were sitting on the couch.”

“The input has to be language-like enough to engage the system,” says Evelina Fedorenko, Associate Professor of Neuroscience at MIT and a member of MIT’s McGovern Institute for Brain Research. “And then within that space, if things are really easy to process, then you don’t have much of a response. But if things get difficult, or surprising, if there’s an unusual construction or an unusual set of words that you’re maybe not very familiar with, then the network has to work harder.”

Fedorenko is the senior author of the study, which appears today in Nature Human Behavior. MIT graduate student Greta Tuckute is the lead author of the paper.

Processing language

In this study, the researchers focused on language-processing regions found in the left hemisphere of the brain, which includes Broca’s area as well as other parts of the left frontal and temporal lobes of the brain.

“This language network is highly selective to language, but it’s been harder to actually figure out what is going on in these language regions,” Tuckute says. “We wanted to discover what kinds of sentences, what kinds of linguistic input, drive the left hemisphere language network.”

The researchers began by compiling a set of 1,000 sentences taken from a wide variety of sources — fiction, transcriptions of spoken words, web text, and scientific articles, among many others.

Five human participants read each of the sentences while the researchers measured their language network activity using functional magnetic resonance imaging (fMRI). The researchers then fed those same 1,000 sentences into a large language model — a model similar to ChatGPT, which learns to generate and understand language from predicting the next word in huge amounts of text — and measured the activation patterns of the model in response to each sentence.

Once they had all of those data, the researchers trained a mapping model, known as an “encoding model,” which relates the activation patterns seen in the human brain with those observed in the artificial language model. Once trained, the model could predict how the human language network would respond to any new sentence based on how the artificial language network responded to these 1,000 sentences.

The researchers then used the encoding model to identify 500 new sentences that would generate maximal activity in the human brain (the “drive” sentences), as well as sentences that would elicit minimal activity in the brain’s language network (the “suppress” sentences).

In a group of three new human participants, the researchers found these new sentences did indeed drive and suppress brain activity as predicted.

“This ‘closed-loop’ modulation of brain activity during language processing is novel,” Tuckute says. “Our study shows that the model we’re using (that maps between language-model activations and brain responses) is accurate enough to do this. This is the first demonstration of this approach in brain areas implicated in higher-level cognition, such as the language network.”

Linguistic complexity

To figure out what made certain sentences drive activity more than others, the researchers analyzed the sentences based on 11 different linguistic properties, including grammaticality, plausibility, emotional valence (positive or negative), and how easy it is to visualize the sentence content.

For each of those properties, the researchers asked participants from crowd-sourcing platforms to rate the sentences. They also used a computational technique to quantify each sentence’s “surprisal,” or how uncommon it is compared to other sentences.

This analysis revealed that sentences with higher surprisal generate higher responses in the brain. This is consistent with previous studies showing people have more difficulty processing sentences with higher surprisal, the researchers say.

Another linguistic property that correlated with the language network’s responses was linguistic complexity, which is measured by how much a sentence adheres to the rules of English grammar and how plausible it is, meaning how much sense the content makes, apart from the grammar.

Sentences at either end of the spectrum — either extremely simple, or so complex that they make no sense at all — evoked very little activation in the language network. The largest responses came from sentences that make some sense but require work to figure them out, such as “Jiffy Lube of — of therapies, yes,” which came from the Corpus of Contemporary American English dataset.

“We found that the sentences that elicit the highest brain response have a weird grammatical thing and/or a weird meaning,” Fedorenko says. “There’s something slightly unusual about these sentences.”

The researchers now plan to see if they can extend these findings in speakers of languages other than English. They also hope to explore what type of stimuli may activate language processing regions in the brain’s right hemisphere.

The research was funded by an Amazon Fellowship from the Science Hub, an International Doctoral Fellowship from the American Association of University Women, the MIT-IBM Watson AI Lab, the National Institutes of Health, the McGovern Institute, the Simons Center for the Social Brain, and MIT’s Department of Brain and Cognitive Sciences.

Building technology that empowers city residents

Kwesi Afrifa came to MIT from his hometown of Accra, Ghana, in 2020 to pursue an interdisciplinary major in urban planning and computer science. Growing up amid the many moving parts of a large, densely populated city, he had often observed aspects of urban life that could be made more efficient. He decided to apply his interest in computing and coding to address these problems by creating software tools for city planners.

Now a senior, Afrifa works at the City Form Lab led by Andres Sevstuk, collaborating on an open-source, Python-based tool that allows researchers and policymakers to analyze pedestrians’ behaviors. The package, which launches next month, will make it more feasible for researchers and city planners to investigate how changes to a city’s structural characteristics impact walkability and the pedestrian experience.

During his first two years at MIT, Afrifa worked in the Civic Data Design Lab led by Associate Professor Sarah Williams, where he helped build sensing tools and created an online portal for people living in Kibera, Nairobi, to access the internet and participate in survey research.

After graduation, he will go on to work as a software engineer at a startup in New York. After several years, he hopes to start his own company, building urban data tools for integration into mapping and location-based software applications.

“I see it as my duty to make city systems more efficient, deepen the connection between residents and their communities, and make existing in them better for everyone, including groups which have often been marginalized,” he says.

“Cities are special places”

Afrifa believes that in urban settings, technology has a unique power to both accelerate development and empower citizens.

He witnessed such unifying power in high school, when he created the website ghanabills.com, which aggregated bills of parliament in Ghana, providing easy access to this information as well as a place for people to engage in discussion on the bills. He describes the effect of this technology as a “democratizing force.”

Afrifa also explored the connection between cities and community as an executive member of Code for Good, a program that connects MIT students interested in software with nonprofits throughout the Boston area. He served as a mentor for students and worked on finding nonprofits to match them up with.

Language and visibility

Sharing African languages and cultures is also important to Afrifa. In his first two years at MIT, he and other African students across the country started the Mandla app, which he describes as a Duolingo for African languages. It had gamified lessons, voice translations, and other interactive features for learning. “We wanted to solve the problem of language revitalization and bring African languages to the broader diaspora,” he says. At its peak a year ago, the app had 50,000 daily active users.

Although the Mandla App was discontinued due to lack of funding, Afrifa has found other ways to promote African culture at MIT. He is currently collaborating with architecture graduate students TJ Bayowa and Courage Kpodo on a “A Tale of Two Coasts,” an upcoming short film and multimedia installation that delves into the intricate connections between perceptions of African art and identity spanning two coasts of the Atlantic Ocean. This ongoing collaboration, which Afrifa says is still taking shape, is something he hopes to expand beyond MIT.

Discovering arts

As a child, Afrifa enjoyed writing poetry. Growing up with parents who loved literature, Afrifa was encouraged to become involved with the theater and art scene of Accra. He didn’t expect to continue this interest at MIT, but then he discovered the Black Theater Guild (BTG).

The theater group had been active at MIT from the 1990s to around 2005. It was revived by Afrifa in his sophomore year when Professor Jay Scheib, head of Music and Theater Arts at MIT, encouraged him to write, direct, and produce more of his work after his final project for 21M.710 (Script Analysis), a dramaturgy class taught by Scheib.

Since then, the BTG has held two productions in the past two years: “Nkrumah’s Last Day,” in spring 2022, and “Shooting the Sheriff,” in spring 2023, both of which were written and directed by Afrifa. “It’s been very rewarding to conceptualize ideas, write stories and have this amazing community of people come together and produce it,” he says.

When asked if he will continue to pursue theater post-grad, Afrifa says: “That’s 100 percent the goal.”