SeqLLM: Augmenting LLMs with Behavioral-Sequence Modeling for High-Stakes Decisions at WeChat Pay
SeqLLM is a novel framework deployed at WeChat Pay that enhances Large Language Models with behavioral-sequence modeling via a compact discrete vocabulary, a two-stage alignment projector, and prefix-guided capability injection, achieving state-of-the-art results in merchant risk control and recommendation benchmarks while preserving the model's original language abilities.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are trying to solve a mystery. You have a detective who is incredibly smart at reading clues written in words—like a diary entry or a news article. This detective is a Large Language Model (LLM), a type of computer brain trained on almost everything humans have ever written. It can understand sarcasm, summarize stories, and explain complex ideas better than almost anyone. But this detective has a blind spot: it doesn't know how to read a long list of actions, like a timeline of every time someone bought a coffee, visited a park, or tapped a screen. That list is called a "behavioral sequence."
In the real world, especially in places like online payments, the truth often hides in the mix of both. A shop might look perfectly normal in its description (the text), but its history of transactions (the behavior) might show it only operates at 3 AM in different provinces, targeting elderly people. If you only read the description, you miss the danger. If you only look at the transaction list, you miss the context. The challenge scientists face is teaching the word-smart detective to also understand the action-smart timeline without making it forget how to speak or reason. If you try to force the detective to memorize a million timelines, it might get so confused that it forgets how to write a simple sentence. This paper tackles that exact problem: how to give a language expert a superpower for spotting patterns in time without losing its ability to think.
The Paper's Story: Teaching a Detective to Read Timelines
The researchers at WeChat Pay and a few universities came up with a clever new framework called SeqLLM. Think of it as a special training camp for our word-smart detective. Their goal was to let the detective look at a merchant's profile (text) and their long history of transactions (behavior) at the same time to spot fraud.
The Problem with the Old Way
Previously, if you wanted a language model to understand a list of actions, you might try to just write the list out as a story. "First, the user bought a shirt. Then, they bought shoes..." But this is like trying to read a novel where every single word is a number; it gets too long, and the detective gets overwhelmed.
Another way was to teach the detective a whole new language of numbers just for actions. But this had a scary side effect: as the detective learned this new language, it started forgetting its old one. It was like a student learning a new subject so intensely that they forgot how to speak their native language. This is called "catastrophic forgetting." The paper shows that if you try to teach a model this way using standard methods, its ability to understand general language can crash from a high score of 0.78 down to a terrible 0.27.
The SeqLLM Solution: Three Magic Tricks
The authors didn't just throw more data at the problem; they built a smarter system with three specific parts:
- The Compact Vocabulary (The Shorthand): Instead of writing out "I bought a $200 item at 2 PM," they created a special shorthand code. They broke every action down into tiny, specific tokens like
<Time:2PM>,<Amount:200>, and<Channel:QR>. This is like giving the detective a set of Lego bricks instead of a pile of sand. It's much smaller, cleaner, and doesn't mix up with the words the detective already knows. - The Translator (The Bridge): These new Lego bricks (tokens) are meaningless to the detective at first. So, they built a "projector," which is like a translator that teaches the detective what each brick means. They didn't just throw the bricks at the model; they used a two-step lesson. First, they taught the model to translate the bricks back into normal English (e.g., turning
<Time:2PM>into "2 PM"). Once the model understood the meaning, they moved to the second step: reasoning. They asked the model to look at a whole sequence of bricks and explain the pattern, like "This person only shops late at night." - The Secret Prefix (The Training Mask): This is the most important trick. Usually, to teach a model a new skill, you make it practice on that skill constantly, which causes it to forget everything else. SeqLLM uses a "prefix-guided" method. Imagine the detective is given a specific instruction card before every task, like "Now, act as a timeline analyst." The model only learns the timeline skill when that specific card is present. When the card is gone, the model just acts like its normal, smart self. This keeps the "timeline learning" from spreading out and messing up the detective's general knowledge.
What They Found
The results were impressive. When they tested this new method:
- No Memory Loss: The model learned to predict the next action in a sequence just as well as the old, forgetful methods (scoring 0.806 vs 0.804), but it kept its language skills intact (scoring 0.789 instead of crashing to 0.27).
- Real-World Success at WeChat Pay: They deployed this system to check millions of merchants every day. Compared to their previous best system, the new SeqLLM caught risky merchants with 97.5% precision (up from 92.0%). Even better, the number of angry appeals from innocent merchants dropped from 12% to about 2%, and they didn't accidentally clear any guilty merchants.
- Better Fraud Detection: When they used the new system's "understanding" to help a different fraud detector, it improved the detection of top-level fraud by 26.8 percentage points. That's a massive jump for a system that processes billions of transactions.
- General Genius: They also tested it on movie and book recommendations. It beat other top models by up to 32% in finding the right next item, all while using 4.8 times less computing power than the competition.
What They Ruled Out
The paper explicitly showed that simply writing out the behavior as a long story (serialization) doesn't work; it actually made the system worse, dropping precision to 83%. They also proved that you can't just "fix" the forgetting problem later by adding more language data; once the model forgets, it's hard to get it back. The only way that worked was preventing the forgetting in the first place using their prefix-guided method.
In short, SeqLLM is a way to give a language expert a new pair of eyes for seeing patterns in time, without making it forget how to speak. It's a smarter, faster, and more accurate way to spot trouble in the digital world, proving that you don't have to sacrifice one skill to gain another.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.