← Latest papers
🤖 machine learning

CGF-Softmax: A Cumulant-Based Softmax Reformulation for Efficient Inference under Homomorphic Encryption

This paper introduces CGF-Softmax, a novel reformulation of the softmax function using the cumulant generating function that eliminates costly homomorphic division and maximum subtraction, thereby enabling efficient and accurate privacy-preserving inference for transformer models under homomorphic encryption with significantly reduced multiplicative depth.

Original authors: Hanjun Park, Byeongseo Min, Jiheon Woo, Min-Wook Jeong, Jongho Shin, Yongwoo Lee, Young-Sik Kim, Yongjune Kim

Published 2026-05-11
📖 4 min read☕ Coffee break read

Original authors: Hanjun Park, Byeongseo Min, Jiheon Woo, Min-Wook Jeong, Jongho Shin, Yongwoo Lee, Young-Sik Kim, Yongjune Kim

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 have a very valuable secret recipe (your data) that you want a famous chef (a powerful AI model) to taste and judge, but you are terrified of giving them the actual ingredients because they might steal the recipe.

Homomorphic Encryption (HE) is like a magical, unbreakable kitchen box. You put your raw ingredients inside, lock it, and send it to the chef. The chef can cook and taste the food inside the box without ever opening it or seeing the ingredients. They can even tell you if the dish is "spicy" or "sweet" (the AI's prediction) without ever knowing what was actually inside.

However, there is one tricky step in cooking that is very hard to do inside this locked box: the Softmax function.

The Problem: The "Spicy" Math Problem

In AI, the Softmax function is like the chef deciding which flavor is the strongest. It looks at all the ingredients, does some math involving huge numbers (exponents), and then divides them to figure out the final percentages.

Doing this inside the magic box is a nightmare for two reasons:

  1. The "Big Number" Explosion: The math involves numbers that get so huge they break the box (overflow). To fix this in normal cooking, chefs subtract the biggest number first. But inside the magic box, you can't easily find the "biggest" number without opening the box to compare them.
  2. The "Division" Trap: The final step requires dividing numbers. Inside the magic box, division is like trying to cut a diamond with a butter knife—it's incredibly slow, expensive, and requires a lot of heavy machinery (computational power) that wears out the box quickly.

Previous methods tried to solve this by either:

  • Guessing the biggest number (which sometimes fails and ruins the taste).
  • Using a very complex, slow recipe to approximate the division (which takes forever and breaks the box's battery).
  • Replacing the whole flavor profile with a simpler, fake spice (which makes the AI less accurate).

The Solution: CGF-Softmax (The "Cumulative Flavor" Trick)

The authors of this paper, CGF-Softmax, came up with a clever new way to cook this dish inside the box. Instead of trying to find the single biggest number or do the hard division, they changed the recipe entirely using a concept called the Cumulant Generating Function (CGF).

Think of it like this:

  • Old Way: "I need to find the spiciest pepper in the bowl, subtract it from everything, and then divide the whole bowl by the total heat." (Hard to do in a locked box).
  • CGF-Softmax Way: "Instead of looking for the single spiciest pepper, let's just measure the average heat and the variety of heat in the whole bowl. We use these two simple stats to adjust the flavor of every single ingredient at once."

By using the average and the spread (variance) of the data, the new method:

  1. Skips the "Biggest Number" Hunt: It doesn't need to find the maximum value. It just shifts everything based on the average, which is easy to calculate in the box.
  2. Eliminates the Division: It folds the "dividing" part right into the exponent (the power) of the math. This means the chef never has to use the slow, heavy division machine.

The Results: Faster, Cheaper, and Just as Tasty

The paper tested this new method on two types of AI chefs:

  1. Vision Transformers (ViT): Models that look at images (like identifying a cat vs. a dog).
  2. Large Language Models (LLaMA): Models that read and write text.

What they found:

  • Speed: Because they removed the hard division and the "find the max" step, the new method is 4 to 6 times faster (in terms of computational depth) than the previous best methods. It's like switching from a slow, manual car wash to a high-speed automated one.
  • Accuracy: Despite being faster, the food tastes almost exactly the same. The AI's accuracy dropped by less than 1% compared to the perfect, unencrypted version.
  • Efficiency: It uses much less of the magic box's "battery" (computational levels), meaning you can run much larger and more complex AI models without the box breaking.

Summary

CGF-Softmax is a new mathematical trick that lets AI models make decisions on encrypted data without needing to do the slow, expensive, and risky math operations (division and finding maximums) that usually break the system. It achieves this by swapping a complex "search and divide" recipe for a simpler "average and adjust" recipe, resulting in a system that is both secure and highly efficient, without sacrificing the quality of the AI's answers.

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 →