Inside an AI mind – do machines think like we do?

Tech Science 30. okt 2025 8 min Professor, Head of Section Lars Kai Hansen, Postdoc Lenka Tetková Written by Morten Busch

Neural networks are brittle black boxes — dazzling one moment, failing the next. Researchers at DTU have found a hidden pattern: convexity. Strikingly, it mirrors how our brains organise ideas — a clue that could bring us closer to AI we can truly trust. But how can a basic mathematical concept tell us something about the way machines “think”?

Interested in Tech Science? We can keep you updated for free.

Artificial intelligence has been hailed as a revolution, but reality is a bit more complicated. Generative models can write essays, generate images, even assist doctors. Yet despite their fluency, they remain a black box: We are only starting to learn how they organise knowledge or why they sometimes make elementary mistakes with complete confidence.

That mystery has real consequences. And it’s not just academic, it touches every place we want to use AI in the real world.

“They perform brilliantly in familiar territory but can fail spectacularly when faced with the unexpected,” says Lars Kai Hansen, Professor at DTU Compute. “Their ability to generalize has limits and this leads to debate over whether AI can be trusted outside controlled environments.”

Lars Kai Hansen and his colleagues believe they have found new clue to the inner workings of generative models. They call it convexity. In simple terms, convexity means that concepts form smooth, continuous regions rather than being scattered. Hansen offers a cat analogy: if all “cat” examples form a smooth region, moving from one cat to another never takes you outside the concept.

“We have found a new mechanism, which we call convexity,” Hansen explains. “If you draw a line between two cats, everything you meet along the way is also a cat. That seems to provide for better generalisation.”

It sounds simple, almost too simple — but this neatness is exactly what gives convexity its power.

A hidden shape called convexity

Convexity turns out to be a hidden pattern inside AI — and it looks surprisingly like the way we humans sort ideas. Imagine arranging family photos: you don’t scatter “cats” and “dogs” randomly, you group them neatly. Convexity shows deep networks form smooth, continuous regions for each concept.

That simple order makes a big difference. It helps machines learn from fewer examples, cuts down the need for giant labelled datasets, and even reveals when extra layers in a network are just dead weight. Like trimming branches from a tree, pruning based on convexity can make AI models faster, leaner, and more sustainable.

But there’s a catch: adapting giant models — a process called fine-tuning — takes labeled data, time and computing power.

“Fine-tuning is expensive, and the more convexity in the pre-trained network, the more ready it is for fine-tuning,” the study’s first author postdoc Lenka Tetkova fra Department of Applied Mathematics and Computer Science Cognitive Systems på DTU Orbit explains.

This was the breakthrough for the team. By building tools to measure convexity, they showed that it appears everywhere — in text, sound, images, even medical scans. And critically, convexity could predict in advance how well a model would adapt.

That matters because AI stumbles on data it has never seen before.

“Out-of-distribution is difficult, and generative AI will rather give a wrong answer than none at all,” Tetkova says. Convexity could give us a way to build systems that know their limits — models that are not only more efficient but also closer to human-style understanding.

For the first time, convexity offers a rare bridge between human and machine intelligence — a structural clue that might help make AI both transparent and trustworthy.

Measuring the geometry of thought

For decades, researchers have puzzled over what neural networks actually learn. The algorithms can recognise faces, translate speech, or read brain scans with astonishing accuracy. However, what goes on inside has largely been a mystery.

For Hansen, this question of explainability has been central. “When we present an analysis result, it is not enough just to say what the network has learned and how well,” he says. “We also need to explain where in the network it has learned it, how certain it is, and how much uncertainty there is. That is why we have worked with explainable AI for many years.”

As models grew ever larger, trained on billions of words and images, the mystery deepened. It was like being handed a crossword answer without the clues — you know the solution, but not how you got there. To break through, Hansen and his colleagues turned to mathematics, asking whether the geometry of knowledge inside the network might reveal a hidden order.

Here, psychology provided a clue. “There is a long tradition in cognitive science showing that humans organise concepts in convex regions,” Hansen explains. “That means if you move from one example to another — say, from one cat to another — everything you meet along the way is still a cat. We wanted to test if the same principle shows up in AI models.”

To measure it, the team used two tricks. One was like stretching a string between two points to see if it stayed inside the same category. The other followed the “winding roads” of the data itself — closer to how both humans and AI actually experience variation.

It’s a bit like asking not just for the shortcut, but for the scenic route too.

The results were striking. “We were surprised by how pervasive convexity turned out to be,” Hansen recalls. “And the pattern held across every dataset we tested. It was a strong signal that the models are learning in ways that mirror human cognition.”

How learning reshapes AI

One of the most surprising findings was that convexity wasn’t a static property. It grew as networks were trained for specific tasks. In other words, the more a model learned, the smoother and more organised its internal map of concepts became.

“Fine-tuning did not just improve performance,” Tetkova explains. “It actually increased convexity in the representations. That was a key observation, because it links geometry directly to learning capacity.”

It’s like a photograph coming into focus: blurry at first, edges sharpening until crisp. Convexity tracks that sharpening, showing how concepts gradually take on clearer and more reliable boundaries.

This discovery touches a much bigger question: do machines and humans share universal ways of organising knowledge? If so, convexity could be more than a mathematical curiosity — it might be a common thread in how both brains and algorithms form concepts.

“It suggests there may be a deeper order in how concepts are formed,” Hansen concludes. “And if that is true, it could give us a new key to building AI systems that learn more like we do.”

When machines think like humans

To uncover these patterns, Tetkova and her colleagues needed a way to look inside the “black box” of deep learning. Standard tests could tell you whether a model got the answer right — but not how it reached it. So the team developed mathematical tools to map the hidden spaces where AI stores its concepts.

“When we talk about convexity, it is really about the geometry of these spaces,” Tetkova explains. “Imagine each object — a cat, a dog, a horse — placed in a high-dimensional space. The question is: what shape do the regions for each category take? Are they scattered and irregular, or do they form compact, convex clusters?”

To test this, the researchers tried two approaches. The first was like drawing a straight line between two cities on a map — does the route stay inside the same “country” of meaning? The second followed the winding highways of the data itself, a path that better reflects how both humans and AI experience variation.

“Straight lines can be misleading in complex spaces,” Tetkova notes. “Graph convexity lets us trace the natural bends in the data, like following winding roads instead of straight lines on a map — it is closer to how both humans and networks actually experience variation”

The team then tested this across a wide spectrum of domains, from language models and speech recognition to human activity and medical imaging. It was like checking if gravity works the same on Earth, the Moon, and Mars.

“We wanted to stress-test the idea,” she recalls. “So we chose five very different types of data — like text, images, or sound. The fact that convexity shows up everywhere makes the result much more compelling.”

Why convexity matters

Another crucial step was to compare networks before and after fine-tuning. By measuring convexity at each stage, the researchers could literally watch how the AI’s “map of knowledge” reshaped itself layer by layer.

One surprising finding was that convexity could also reveal when a network was overbuilt. Convexity revealed when later layers added little — like knowing when a cake has enough layers. More wouldn’t make it tastier, just heavier.

“Convexity revealed when extra layers added little value — a clue for making networks more efficient,” Hansen notes.

This combination of mathematical analysis, cross-domain testing, and layer-by-layer measurement gave the researchers a new lens on deep learning: a way to turn abstract geometry into practical insights about how networks learn, adapt, and generalise.

A shortcut to the future of AI

When the researchers looked across many different domains — from speech to human activity to blood cell images — they found the same pattern again and again. Convexity wasn’t rare — it was the rule, even before fine-tuning.

“We were surprised to see how pervasive convexity actually was,” Hansen recalls. “It wasn’t limited to a single type of network or data. It emerged again and again across very different modalities.”

As information moved deeper through the layers of a network, categories gradually sharpened. Early layers were fuzzy, like sketches with blurred outlines. By the final layers, each concept was crisply defined — neatly bounded in its own space.

Hansen emphasises that this progression matters. “It tells us that learning is not just about separating classes, but about shaping them into regions that support generalisation.”

Fine-tuning made the picture even clearer. When models were adapted to specific tasks, convexity grew stronger still — carving out sharper, more reliable boundaries between concepts.

“Fine-tuning didn’t just improve performance,” Hansen explains. “It increased convexity — linking geometry directly to learning capacity.”

Toward trust and transparency

The team then tested whether convexity could do more than just describe what a model had learned — could it predict success? The answer was yes.

AI models already trained on huge datasets (pre-trained networks) with higher convexity almost always performed better when fine-tuned on small labelled datasets.

“That is important, because fine-tuning is expensive,” Hansen stresses. “If we can measure convexity beforehand, we have a way of knowing which models are best prepared for the job — before spending weeks or months on costly training.”

This turns convexity into more than a mathematical curiosity. It could become a guidepost for designing, testing, and even pruning AI systems. If it proves to be a general feature of machine learning, convexity might reshape how we decide which models to trust.

And for Hansen, the implications are not just technical. “By showing that AI models exhibit properties that are also fundamental to human conceptual understanding, we move closer to creating machines that think in ways that are more comprehensible,” he says. “That is vital for building trust and collaboration in areas like healthcare, education, and public service.”

One immediate payoff is efficiency. Convexity could act like a quality stamp, helping researchers spot which models are most promising instead of wasting time and computing power on poor candidates.

“Convexity may give us a shortcut,” Hansen notes. “If we can measure it early, we don’t need to run full training cycles to know whether a model has potential.”

Peeking inside the black box

One of AI’s biggest mysteries is explainability: how do we know what the machine is really “thinking”? Convexity offers a rare clue. The shapes it forms inside the network look surprisingly similar to the way our own brains sort ideas, hinting at a shared language between humans and machines.

“It suggests a way of peeking inside the black box,” Tetkova explains. “We are not just interpreting outputs — we are beginning to map the internal geometry in a way that connects directly to human concepts.”

But this is only the beginning. The researchers stress that much more theory is needed to explain why convexity emerges — and whether future AI can be deliberately designed to use it.

“We believe convexity might be a fundamental principle,” Tetkova says. “But we need to test how far it goes, and whether we can use it to build better models, not just analyse the ones we already have.”

For now, the finding offers a tantalising glimpse: deep learning may rest on the same geometric order that helps humans make sense of the world. AI brains may not be so alien after all — they may think more like ours than we imagined. That’s a bold claim, of course, but it shows just how quickly the frontier between human and machine is shifting.

Lars Kai Hansen has MSc and PhD degrees in physics from University of Copenhagen. Since 1990 he has been with the Technical University of Denmark, whe...

Lenka Tětková is a postdoctoral researcher at the Technical University of Denmark’s Department of Applied Mathematics and Computer Science. She studie...

Explore topics

Exciting topics

English
© All rights reserved, Sciencenews 2020