← Latest papers
📊 statistics

Improving TensorSketch Using Complex Random Variables

This paper introduces a novel variant of the TensorSketch algorithm that leverages complex random variables to achieve a superior variance bound of 2p/D2^p/D for high-dimensional polynomial kernels while maintaining the efficient input-sparsity running time of the original method.

Original authors: Amit Sharma, Mohammad Azhar Khan, Rameshwar Pratap, Keegan Kang

Published 2026-08-12
📖 5 min read🧠 Deep dive

Original authors: Amit Sharma, Mohammad Azhar Khan, Rameshwar Pratap, Keegan Kang

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 massive jigsaw puzzle, but instead of pieces, you have millions of numbers representing data points. In the world of machine learning, computers often need to find patterns by comparing these numbers. Sometimes, the patterns are simple, like a straight line. But often, the world is messy and curved, so computers use "kernels"—mathematical magic tricks that let them see complex, curved relationships between data points. One popular trick is the "polynomial kernel," which looks at how features interact when multiplied together many times.

The problem is that as you multiply these features together more and more times (raising them to a higher "degree"), the number of pieces in your puzzle explodes. It grows so fast that even the fastest supercomputers would get stuck trying to calculate every single piece. To fix this, scientists invented "sketching." Think of sketching like taking a high-resolution photo and compressing it into a tiny thumbnail. You lose some detail, but you keep the most important shapes and colors, and you can process the thumbnail instantly. For years, the best way to do this for polynomial puzzles was a method called TensorSketch. It was fast, but it had a flaw: as the puzzle got more complex, the "thumbnail" became a bit fuzzy, and the computer's guess started to wobble with more error.

Recently, a team of researchers asked a curious question: What if we stopped using just regular numbers and started using "complex" numbers—numbers that include an imaginary part, like the square root of negative one? They wondered if this imaginary twist could make the thumbnail sharper. A previous study showed that for one type of sketching, using complex numbers did make the picture clearer (reducing the fuzziness). However, that method was slow and clunky, like trying to carry a heavy backpack while running. The researchers in this paper wanted to know: Can we get that super-sharp, complex-number clarity without the heavy backpack? Can we make the fast, lightweight TensorSketch method just as good as the slow, heavy one?

The paper, titled "Improving TensorSketch Using Complex Random Variables," says yes. The authors, Amit Sharma, Mohammad Azhar Khan, Rameshwar Pratap, and Keegan Kang, have built a new version of TensorSketch that uses these complex numbers but keeps the speed of the original. They didn't just guess; they proved it with math and tested it with real data.

Here is how they did it. The original TensorSketch works by taking your data, mixing it up with random signs (like flipping a coin to decide if a number is positive or negative), and then squishing it down. The new method, which they call "Complex-to-Real TensorSketch" (or CtR TensorSketch), changes the coin flip. Instead of just heads or tails (1 or -1), they use a four-sided die that lands on 1, -1, or two imaginary numbers (i and -i). This might sound like it would make the result a weird, imaginary mess, but they have a clever trick. They take the result, which is a complex number, and split it into two parts: the "real" part and the "imaginary" part. Then, they stick these two parts side-by-side to form a new, real-world vector.

The magic happens because of how these imaginary numbers interact. When the researchers crunched the numbers, they found that the "fuzziness" (or variance) of their new method grew much slower than the old one. In the old method, the error grew like 3p3^p (where pp is the complexity of the puzzle). In their new method, the error only grows like 2p2^p. That might sound like a small difference, but in the world of exponential growth, it's a massive improvement. It means for complex puzzles, their new sketch is significantly more accurate.

Crucially, they proved that this new method is still just as fast as the old one. While other methods that use complex numbers require the computer to do heavy, slow calculations (taking time proportional to the full size of the data), their method stays "input-sparse." This means it only spends time on the parts of the data that actually exist, ignoring the zeros. They showed that the time it takes to run their algorithm is O(p(nnz(x)+DlogD))O(p(nnz(x) + D \log D)), which is the same speed as the original TensorSketch.

To make sure this wasn't just a math trick that worked on paper, they ran experiments. They tested their method on synthetic data (made-up numbers) and real-world datasets like the MAGIC Gamma Telescope data and COD-RNA. They compared their CtR TensorSketch against the standard TensorSketch and other complex methods. The results were clear: their new method produced much more accurate approximations (measured by something called KL divergence, which checks how similar the sketch is to the original) while taking the same amount of time to compute. In fact, in some tests, their method was even faster than the other complex methods because it didn't have to do the heavy lifting.

The paper also addresses a potential confusion. They showed that simply using complex numbers in a different type of sketch (called CountSketch) doesn't automatically make it better. The improvement only comes from the specific way they combined the complex numbers with the TensorSketch structure. This proves that their result isn't a fluke; it's a specific, non-trivial improvement that comes from the way the math cancels out certain error terms.

In short, this paper takes a fast but slightly fuzzy tool (TensorSketch), upgrades it with a bit of imaginary math to make it sharper, and ensures it stays fast. It's like taking a quick sketch artist and giving them a special set of colored pencils that let them capture more detail without slowing down their hand. For anyone building machine learning models that need to understand complex relationships in huge datasets, this new method offers a way to get better answers without waiting longer for the computer to finish its work.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →