In the invisible architecture of modern technology, something as seemingly simple as sorting data plays a starring role. Whether it’s ranking web pages, organizing your photo library, or training massive AI models, sorting—organizing data in a specific order—is a foundational operation. Every second, countless devices around the world are engaged in this task. And yet, despite its ubiquity, sorting remains one of the more stubborn bottlenecks in computer science.
Conventional systems have always handled sorting by storing data in one place and processing it in another. This separation between memory and computation creates friction—data has to travel back and forth, consuming energy and time with each transfer. Imagine having to walk to a filing cabinet every time you want to alphabetize a list. Now imagine doing that billions of times per second.
This inefficiency is not merely a technical inconvenience; it’s a structural flaw baked into the very heart of traditional computing. And for years, one fundamental question has echoed through the corridors of research labs: What if memory could process data by itself?
The Sorting Revolution Starts in Memory
That question now has a groundbreaking answer, thanks to a team of researchers at Peking University. Led by Professor Yuchao Yang and detailed in a recent publication in Nature Electronics, the team has developed a reconfigurable sort-in-memory system that could transform how computers handle data. By harnessing the power of memristors—tiny, brain-inspired electronic devices that remember the amount of charge that passed through them—the team has created a hardware system that doesn’t just store information, but sorts it where it lives.
At the heart of this innovation is a clever twist on a longstanding concept in computing: computing-in-memory (CIM). CIM has shown promise for speeding up tasks like matrix multiplication and convolution, especially in AI applications. But until now, sorting has remained a notoriously elusive challenge within CIM. Sorting operations require flexible comparisons, dynamic decision-making, and irregular memory access patterns—qualities that traditional CIM architectures weren’t designed to handle.
“Sorting has long been regarded as a ‘hard nut to crack’ in computing-in-memory technology,” explains Yaoyu Tao, corresponding author of the study. “It’s fundamentally different from the kinds of linear, structured operations CIM excels at.”
Cracking the Code with Memristor Arrays
To address this challenge, the researchers built a novel sort-in-memory system using 1T1R memristor arrays—where “1T1R” stands for one transistor, one resistor. This combination allows data to be both stored and manipulated directly within the memory unit, enabling in-situ sorting, or sorting that happens right where the data resides.
This system is paired with a trio of powerful peripheral circuits: a digit processor, a digit selector, and a state controller. These modules don’t simply execute instructions—they reconfigure themselves depending on the task, adapting to various data types including integers, floating-point numbers, and more. This flexibility is what allows the system to handle the messy, unstructured nature of real-world sorting problems.
The brilliance of the design lies in its multi-parallelism strategies. It can sort multiple values across different banks (multi-bank parallelism), operate on individual bits across data (bit-slice parallelism), and even manage multiple levels of conductance within a device (multi-level parallelism). These layers of efficiency make it possible to perform complex sorting tasks at astonishing speeds, all while slashing energy usage.
Why Sorting Still Matters in the Age of AI
It might seem trivial to focus on sorting at a time when artificial intelligence is generating music, painting portraits, and answering questions in human-like prose. But behind every machine-learned insight or AI decision lies an ocean of data that must be sorted, ranked, and prioritized.
“Sorting algorithms are vital to data processing,” Tao emphasizes. “Whether it’s training large language models, planning robotic paths, or navigating reinforcement learning environments, systems need to quickly evaluate and rank a massive number of possible actions or outcomes.”
However, existing PIM (processing-in-memory) architectures have struggled to scale sorting tasks due to inefficiencies in memory access and control flow. This limits their deployment in many real-world AI and data-intensive scenarios. By contrast, the new sort-in-memory system not only supports these tasks—it is designed for them.
From Research Lab to Real-World Impact
The implications of this research stretch far beyond academic curiosity. In fields like healthcare, autonomous manufacturing, and smart transportation, massive volumes of sensor and diagnostic data need to be sorted in real-time. Sorting isn’t just a convenience here—it’s a matter of safety, speed, and responsiveness.
In the future, this sort-in-memory technology could find a home in data centers handling scientific databases, hospitals monitoring vital patient information, or even self-driving vehicles navigating through crowded streets. Anywhere data needs to be organized quickly and efficiently, this system could become an indispensable tool.
The team is already working on the next phase: integrating their sort-in-memory design with broader CIM platforms used in AI and machine learning. This vision could soon lead to general-purpose computing systems where sorting is no longer a computational roadblock but a built-in feature, running quietly and efficiently in the background.
A New Way of Thinking About Computing
The deeper story here is one of changing paradigms. For decades, computing has relied on a back-and-forth dance between memory and processor. That model worked well when data was scarce and hardware was king. But today, in the age of information overload and AI ambition, the old model is cracking under its own weight.
By merging storage and computation, and solving the long-standing challenge of in-memory sorting, Yang and his team are charting a new path forward—one where data organizes itself, and energy-intensive shuffling becomes a relic of the past.
It’s easy to overlook sorting. It’s invisible, behind-the-scenes, technical. But sometimes, the smallest unseen actions are the ones that power everything else. And with this breakthrough, the humble act of organizing may have just become the next leap in intelligent computing.
Reference: Lianfeng Yu et al, A fast and reconfigurable sort-in-memory system based on memristors, Nature Electronics (2025). DOI: 10.1038/s41928-025-01405-2.