Shetland Geology
English articles > Article

Let the big model write your phone chip code. What happens?

Updated 2026-11-27 02:25 UTC ยท Machine translation

You probably didn't think about that: the same AI-generated code, running up on the GPU in the data centre, switching to the chip in your phone, might not even be able to compile.

This is not alarmism. A recent research paper from the University of West Lake and the University of Zhejiang was dedicated to testing the ability of several top-linguistic models to write codes on mobile phones, robotics, and Internet-connected devices, which resulted in quite a face-breaking result. When the strongest model is on the mission, the probability of a code running is more than 60 per cent, while the probability of running faster than the original program is only around a quarter.

This paper is called the Smart System to solve this problem. Let's talk today about why it's so hard for AI to write high-performance codes for the peripherals, and how they solved it.

The server and the chip in your pocket, it wasn't a single time. Yes.

Let's get one thing straight: there have been many studies in the academic world that have shown that large-language models have been able to produce the core code of calculation that's good on the GPU on the server, that's what they say.

kernel*: This refers to a lower-level program code for specific computing tasks (e.g. matrix multiplication, volume operation), which usually requires a deep optimization of hardware to run fast.

For example, the Kernel Bench benchmark test is used to measure whether large models can write high-efficiency GPU codes. But all these tests are focused on server-level graphics, like those in Inverda. They have one common feature: the size of the tube, the power capacity and the uniformity of the software ecology, and the programmer needs to focus on one thing, which is to make the code run faster.

The peripherals are completely another world. That's the way you got on your phone. Even more problematic is the stress in the memory of the equipment, the limited amount of batteries and the need to set aside resources for other programmes in the system while running models.

It's not easy for you to practice knives in the kitchen of a five-star hotel and to cook while you're hiding in your cat's kitchen. All you have to do is focus on cooking the food in the hotel kitchen, which is full of food, and you have to be careful not to touch anything at any time, if you don't watch the whole process. If the cooking process in the hotel kitchen is moved directly to their own kitchen, the rate is probably too busy to turn the shovel around.

The research team found that, although a so-called test had previously started to focus on mobile devices, it measured simple tasks such as single operators, which did not involve a complex set of multiple operators or complete model levels. In other words, the title of the current examination is too simple to determine whether a large model is working in a real remote deployment scenario.

Unified language: Let's not have to reread every device.

The central idea of this paper is to introduce something called "the expression of a unified kernel."

: A non-hardware program description, and a large model only needs to express "how do I calculate, how do I move, how do I manage the memory" at this level, without writing a code that a specific chip knows.

Why would you do that? Imagine if you were a Chinese-speaking tour guide, but with the German, Japanese and Brazilian groups, you'd have to sell that foreign language every time. Better yet, you learn a common sign language, express what you want to say, and then hire three professional translators to translate it into German, Japanese, Portuguese. All you have to do is express yourself in a gesture, without grammatical details of each language.

That is exactly what unity of IR is about. The Large Model is no longer directly generated "is responsible for translating this generic expression into a language that can be understood at a specific back end.

The advantage of this design is that a large model, with its optimal experience of learning from one device, can be moved directly to another without having to learn the programming rules and legitimacy limits of the device from scratch. The research team chose to implement the framework as a reference compiler.

TVM*: An open-source deep-learning compiler warehouse that converts a program layer by layer and ultimately produces an enforceable code for different hardware backends (CPU, GPU, etc.)

What happens if you don't? It's actually an indirect answer in the paper, which is the current approach: to direct the model to a back end of primary code. The result is that the model crashes directly on an unknown hardware, because it has to balance the correctness of the calculation logic with the various sub-rules of target hardware, and neither of the two things get mixed up.

Three levels of difficulty, three applications: a real set of tests for the edge AI.

If you want to test, you have to have a decent subject. The team designed a set of benchmark tests called Edge Kernel Bench, which consisted of 331 standard tasks organized in two dimensions.

The first dimension is complexity. First class is called."

The second dimension is classified by application scenario, covering mobile and personal intelligence devices, three categories and three difficulty levels for each scenario.

The advantage of this design is to be able to locate precisely where the problem lies. Just like a doctor, a general "health index" can't be measured, but blood pressure, blood sugar, electrocardiograms can be measured to know which organ has a problem. Edge Kernel Bench is the general question of "Can't I write code on edges" and has been deciphered into a detailed medical report.

The results do support the value of such tiered design. The performance of almost all models is falling off the cliff as the task rises from level I to level III. On the three hardware backends, the highest ratio of "yes and yes" fell from 51 per cent at level 1 to 16.2 per cent at level 2 and to 4 per cent at level 3. This suggests that the ability of the model to accumulate in simple calculations is simply impossible to apply directly to complex multimodular scenarios.

Hardware also selects models. The correct rate on the CPU is generally much higher than on the GPU, with a maximum of 94.5 per cent for the first-level task, compared to 79.6 per cent for CUDA and 73.5 per cent for OpenCL. The reason behind this is not hard to understand: GPU needs to deal with how the threads are distributed, how to map such more complex decisions, and it is possible to lose everything when one step goes wrong. In both GPU programs, CUDA generally performed better than OpenCL, and researchers speculate that this may be due to the fact that the model has seen more high-quality CUDA code samples and that OpenCL has relatively little exposure.

When "coding through encounters" runs faster: correctness and performance are two yards. Yes.

One of the findings of this paper is particularly worth mentioning.

The strongest model, at a production attempt, had a success rate of 73.5 per cent for code compilation and 64.5 per cent for functionality, but only 25.5 per cent faster.

This means that the fact that a code can be compiled and run the right results does not mean that it runs fast. These three things are layered and independent of each other.

This is more than you have written a text that is completely grammatical and well-articulated, but the points given by the reading teacher are only passing lines, because, without linguistics and runaways, the text is flat and loose in structure, and there is no color at all. Runs and runs fast, with a set of fine considerations on memory access patterns, parallel movement, and data re-use, which cannot be replaced by the correct grammar alone.

The research team also compared the resulting code to two sophisticated industrial reasoning engines, one of which was Ali's.

This points to one thing: large models now have a chance, in simple calculations, to go beyond industrial engines that have been grinding for many years, but when complex multi-calculators are involved, the gap opens.

Reasons for failure: Memory management is a disaster area

The research team grouped all cases of failure into six categories: grammatical interface error, shape type error, memory error, parallel error, correctness error, other issues such as overtime. Logically, memory errors accounted for 34 per cent, the largest source of failure, followed by a syntax interface error of 25.4 per cent.

Interestingly, most memory errors are not due to inadequate memory, but rather to unlawful distribution, such as the distribution of buffer zones in an undesirable field. This means that the model does not understand "what to do with the memory and what to do with the target hardware."

Different models show different "soft ribs." In CPU, for example, 54 per cent of the GPT-5.6-sol failures were grammatical interfaces, while 56.2 per cent of Gemini-3.7-Flash failures were memory problems. It is as if two interns had made mistakes in a completely different direction, one always misforming the document, the other always misplaced things, the nature of the problem was completely different, and the type of error that was required was naturally different.

LEKA: Dismantling a brain into four specialists

Since one-time generation was not ideal, the research team simply designed an iteratively optimized smart body system, called LEKA, full name.

The central idea of LEKA is to divide decision-making, which would have been a model in its entirety, into different abstract layers, each of which is entrusted to a specialized intelligence body.

: each layer has an independent optimisation space by splitting at the abstract level from the top of the computational chart structure to the middle of the circular movement structure to the bottom of the specific hardware command

The logic behind this creative vision is that the more complex a task, the more it needs to be remembered at the same time. If a model is to be concerned with the overall structure of the calculation and how to distribute the memory of a specific line code, its "focus" will be pulled apart, and the probability of losing or losing is greatly increased.

It's like a hospital splitting system. If you're not feeling well, just go into a general practitioner's office and let him judge whether you're having a heart attack, whether there's a bone defect, what's a skin allergy, the doctor probably gets busy and forgets it. It would be more reasonable to divide first, to place heart problems at the heart, to place bone problems at the bone, to focus only on the part in which the doctor in each section is best at, and to improve the efficiency and accuracy of the diagnosis as a whole. Without such a division of labour, one person is responsible for decision-making at all levels, with more complex tasks, and the error rate is bound to rise.

LeKA has three specific layers. The top layer is called the syntax layer, which is responsible for algorithm expression, computational chart structure, and integrated splitting decision-making across the board, expressed in TVM. The bottom is the target source layer, which is responsible for the details of the achievement of a particular hardware, such as CUDA's memory, OpenCL's working group size, or LLVM's quantitative command selection.

In addition to the three layers of optimized intelligence, there is a dedicated "doesn't read or write" in the system, which specializes in running performance testing, analysing which level of bottlenecks occur, and then sending the diagnosis report to the corresponding intelligence level for processing. This role is a bit like the hospital's medical examination centre, which does not give you a prescription in person, but it tells the doctors what to focus on.

The entire system also maintains a single "" that records all versions of each optimized attempt, even if a branch is later abandoned, its historical record will be kept to facilitate retroactive and comparative purposes. It's like writing a paper with a version of the control software, and every change leaves a mark, and even if a paragraph is subsequently deleted, you can find it back and see what it was like.

Effect speaking: from 13% to 43.5%

The team randomly extracted 69 tasks from the test set, comparing them with one-time generation, a purely Claude Code programming assistant, and LEKA, all using the same large bottom model, which ensures fairness.

The results were pretty bright. Compared to one-time generation, LEKA pulled the success rate of compilation from 60.9 per cent to 100 per cent, the functional correct rate from 42 per cent to 100 per cent and the rate of "run faster than the TVM benchmark" from 13 per cent to 43.5 per cent.

The LEKA is still in the lead, 43.5 per cent versus 26.1 per cent, and the overall rate of improvement is 3.8 times higher than the pure Claude Code programming assistant who uses the same model and budget at the same time.

It is worth wondering in detail that the relative increase of LEKA in second-tier tasks is greater than that of the first, with geometric mean acceleration increasing from 3.4 to 4.7 times. The researchers explained that the more complex the task, the more coordinated decision-making is required, and that the advantages of the LEKA stratification happen to be more easily realized in this context. At the third level, however, the rate of acceleration fell 2.9 times, probably because of the reasoning of the bottom base model itself, which also encountered the ceiling in the face of a very complex long chain of dependence.

A specific case was also raised in the paper, which is a good example of how the LEKA layers of intelligence work together. The mission is...

This case looks like a relay race. The first beater reoriented the track to the best, the second beater sprinted on that basis, the third beater made the final fine adjustment, and the total of the three beats down was far more than any single person could have done. In the absence of such an incremental, mutually-reserved mechanism, it is likely that the third-level optimization will inadvertently reverse the hard-wired road to the first level and waste previous efforts.

Some outstanding issues

The author of the paper also frankly referred to several limitations. The current test covers only the three backends of CPU, CUDA GPU and OpenCL GPU, and the more specialized AI accelerator chip such as NPU has not been included in the test. In addition, the current assessment is that each task is running on a separate CPU or GPU basis, without any reference to a scenario where a task is simultaneously calculated using the synergies of CPU and GPU, and that this is a synergetic implementation that involves more complex task allocation and resource sharing issues and is a worthy future direction.

It's in the back.

After reading this paper, one of my somewhat surprising findings is that memory errors account for more than one third of the failures, and that it is mainly not because of insufficient memory capacity, but because the distribution itself is not legal. This suggests that the big model's understanding of the rules at the bottom of the hardware is weaker than we thought. It may know how to write a semantic calculation logic, but it is quite superficial to understand who exactly controls a piece of memory and when it should be released. This leads me to the idea that a high-quality sample of memory management legitimacy in training data may be much more scarce than a sample of algorithmic logic, which, after all, is all over the open source repository, often hidden in internal files or in sub-rules that only senior engineers understand.

Another thing to remember is that the gap between "run" and "run fast" is deeper than expected. The gap between the correct rate of 64.5 per cent and the acceleration rate of the above 25.5 per cent reminds us that, in the future, a code generation model will be evaluated to the extent that it is far from sufficient to be tested, and that the performance dimension will have to be individually examined, otherwise it will be easy to be confused by the apparent correctness.

What makes me think even further is that the idea of tieredly dealing with complex tasks is actually applicable in many areas, and the stratification in software engineering, reporting in corporate governance, is essentially reducing the cognitive burden of a single decision node in a similar way. The value of LEKA may not be just a specific scenario of writing code for peripheral devices, but rather a sample of a line of thought: when a task is so complex that a single intelligent body is out of mind, it is more cost-effective to break it than to carry it.

Q&A

Q1: What is Edge Kernel Bench?

A: Edge Kernel Bench, a large model code generation baseline test for peripheral equipment developed by the University of West Lake and the University of Zhejiang, consists of 331 missions covering scenes such as mobile phones, robots, and the Internet, to assess whether large models can write correct and efficient ground-level computing codes for resource-limited edge hardware.

Q2: Why is it harder for a large model to write a code on a peripheral device than on a server GPU?

A: Because of the multiplicity of hardware at the edge, the ecological fragmentation of the software, memory and power stress, the models need to ensure that the calculations are correct and optimize performance with limited resources, while the server GPU is generally adequate, with relatively single targets, and only speed.

Q3: How does LEKA optimize the code?

A: LEKA achieves three tiers of optimized work by decomposing it into a map structure, movement control, hardware, each with a dedicated intelligence body, which in turn uses hardware feedback to guide the iterative process, increasing the proportion of missions running faster from 13 per cent to 43.5 per cent of one-time generation.