Accelerating Time Series Foundation Models with Speculative Decoding
This paper introduces a speculative decoding framework tailored for continuous patch autoregression in time series foundation models, which leverages a cheap draft model to propose future patches and a target model to verify them in parallel, achieving up to 3.0x inference speedup while maintaining accuracy guarantees.
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 predict the future, but not with a crystal ball—instead, you are using a super-smart computer that looks at patterns in data like electricity usage, traffic flow, or weather. This field is called time series forecasting. For years, these computers have been getting better and better, but they have a annoying habit: they are slow. They work like a person reading a book one word at a time. If you ask them to predict the next 100 hours of weather, they have to calculate hour one, then use that result to calculate hour two, then hour three, and so on. They can't skip ahead or look at the whole picture at once because they are built to be very careful, step-by-step. This is a problem because in the real world, like when a power grid manager needs to decide how much electricity to buy right now, waiting for a slow computer to finish its long, step-by-step calculation is too late. We need answers fast, but we also need them to be accurate.
This paper introduces a clever trick to make these slow, careful computers much faster without making them less accurate. The authors call it "speculative decoding," which is a fancy way of saying "guess and check." Imagine you are writing a story with a friend. You (the slow, careful expert) usually write one sentence at a time. But your friend (a fast, slightly less careful guesser) can shout out the next five sentences in a flash. Instead of ignoring your friend, you quickly read their five sentences. If they look right, you just say "Yes!" and keep going, saving yourself the time of writing them yourself. If one sentence looks wrong, you only fix that one and move on. The paper proves that for these time-predicting computers, this "guess and check" method can make them up to 3.0 times faster while keeping the predictions almost as good as if they had done the hard work alone.
The Problem: The Slow, Step-by-Step Robot
Time series foundation models are like giant, super-smart robots that have read billions of data points. They are amazing at predicting things like how much traffic will be on a highway tomorrow or how much energy a city will need next week. But they have a bottleneck: they are "autoregressive." This means they are like a person stacking dominoes. To predict the 100th domino, they must first predict the 99th, then the 98th, and so on, all the way back to the start. They cannot predict the whole future at once. If you want a forecast for a long time ahead (a "long horizon"), the robot has to take hundreds of slow, sequential steps. It's like asking a snail to run a marathon; it will get there, but it will take a long time, and by the time it arrives, the race might be over.
The Solution: The Fast Sidekick and the Careful Boss
The authors realized that while the big robot is slow, a smaller, cheaper version of that robot (called a "draft" model) can often guess the next few steps almost as well as the big one. However, the small robot isn't perfect. So, the paper proposes a team-up strategy:
- The Fast Sidekick (Draft): A smaller, faster computer guesses the next K patches of the future all at once. Think of this as a fast typist who types out the next five words of a sentence in a blink.
- The Careful Boss (Target): The big, slow, super-accurate computer doesn't type the words itself. Instead, it looks at the five words the fast typist wrote. It checks them all in a single, parallel glance.
- The Decision: If the boss agrees with the fast typist, it says "Accepted!" and moves on. If the boss disagrees with one of the words, it fixes just that one word and stops the fast typist from guessing further.
The magic here is that the big computer usually has to do one step at a time. With this trick, it can accept a whole block of steps in one go. The paper shows that this works even though the data isn't made of words (like in a language model) but of continuous numbers (like temperature or voltage). The authors had to invent a new way to "check" the numbers because you can't just compare probabilities like you do with words; instead, they use a mathematical "distance test" to see if the guess is close enough to the truth.
What They Found
The team tested this idea on five different families of time-predicting models, including Timer-XL, TimesFM, Sundial, Time-MoE, and TiRex. They ran these models on real-world data like electricity grids, weather patterns, and traffic sensors.
- Speed: In many cases, the new method made the models 1.2 to 3.0 times faster. For example, on the Time-MoE model, they achieved a 3.05× speedup on a specific dataset (ETTm1) while keeping the accuracy very high.
- Accuracy: The predictions were almost as good as the slow, careful method. In fact, in some cases, the "speculative" method was even more accurate than the standard method because it corrected errors more often.
- The "Free" Bonus: If the fast sidekick gets all the guesses right, the big boss gets a "bonus" prediction for free. It's like the boss reading the next word without having to type it.
When It Doesn't Work
The paper is very honest about when this trick fails. It doesn't work if the fast sidekick is already as good as the boss (then there's no need to check). It also doesn't work if the boss takes too long to check the guesses compared to how much time is saved. The authors created a mathematical formula to predict exactly when this method will be worth it, so engineers don't have to guess. They found that for some models, like TiRex on certain traffic data, the checking process was too expensive, and the method actually slowed things down.
The Bottom Line
This paper doesn't just suggest a cool idea; it builds a working system that turns a slow, step-by-step process into a fast, parallel one. It proves that you don't have to choose between speed and accuracy. By letting a fast, small model do the heavy lifting of guessing and a big, smart model do the quick job of checking, we can get the best of both worlds. The result is a way to get high-quality forecasts for electricity, traffic, and weather much faster, which could help power grids run more efficiently and traffic flow more smoothly, all without needing to wait for the slow robot to finish its long, lonely walk through the data.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.