A time-decay function is a mathematical weighting scheme that systematically reduces the influence of older data points in a sequence while amplifying the importance of recent observations. In fraud detection, this function is applied to transaction histories to ensure that a user's most recent spending patterns, locations, and merchant preferences dominate the behavioral profile, while activity from months ago exerts minimal influence on the current anomaly score. Common formulations include exponential decay, where weights decrease by a constant factor per time step, and inverse decay, where weight is inversely proportional to age.
Glossary
Time-Decay Function

What is Time-Decay Function?
A mathematical function that assigns decreasing importance to observations as they recede into the past, operationalizing the principle that recent behavior is more predictive of future actions than historical data.
The core rationale is that customer behavior and fraud tactics are non-stationary; a legitimate user's relocation or a fraudster's evolving methodology renders historical data less relevant. By integrating a time-decay function into feature engineering or directly into the loss function of a sequence model, the system becomes more responsive to concept drift. This prevents model stagnation, reduces false positives triggered by outdated normal baselines, and enables the rapid detection of newly emerging fraud patterns that would otherwise be diluted in a uniformly weighted historical average.
Key Characteristics of Time-Decay Functions
Time-decay functions are mathematical formalisms that systematically reduce the influence of older observations in a sequence. By assigning higher weights to recent events, they encode the principle that current behavior is best predicted by the immediate past—a critical assumption in dynamic fraud environments where criminal tactics evolve rapidly.
Exponential Decay Formulation
The most common parametric form, expressed as w(t) = e^(-λt), where λ (lambda) controls the decay rate. A larger λ causes weights to diminish more aggressively, creating a shorter 'memory' horizon. This formulation ensures that the influence of a transaction halves over a consistent time period, known as the half-life. In fraud systems, the half-life is a tunable hyperparameter calibrated to match the velocity of legitimate user behavior changes versus adversarial adaptation speeds.
Inverse Time Weighting
A polynomial alternative defined as w(t) = 1 / (1 + k*t). Unlike exponential decay, this function exhibits a heavier tail, meaning very old observations retain non-negligible influence for longer. This is useful when modeling long-term baseline behaviors that should not be entirely forgotten, such as a user's stable annual spending patterns. The parameter k adjusts the steepness of the initial drop-off without fully extinguishing historical signal.
Windowing and Truncation
Practical implementations often combine a decay function with a hard temporal window to bound computational cost. Weights for events older than a cutoff threshold are explicitly set to zero. This creates a finite receptive field for sequence models. Common strategies include:
- Sliding windows: Fixed-length lookback (e.g., 90 days)
- Landmark windows: All data since a significant event (e.g., password reset)
- Fading windows: Weights decay to zero at the boundary, ensuring smooth transitions
Application in Feature Engineering
Time-decay functions transform raw event streams into weighted aggregate features for downstream classifiers. Instead of simple counts, features become decay-weighted sums. For example, a decay-weighted transaction count gives full weight to today's transaction, half weight to yesterday's, and near-zero weight to last month's. This captures recency-sensitive velocity—a sudden burst of activity today will dominate the feature value, triggering anomaly scores even if the raw monthly total appears normal.
Decay in Sequence Model Attention
Modern architectures like the Temporal Fusion Transformer and Mamba incorporate learned or structural time-decay directly into their attention or state-space mechanisms. Rather than a fixed exponential function, these models learn input-dependent decay rates. A transaction from a known compromised merchant might be assigned a slower decay, retaining its relevance longer, while a routine login fades quickly. This adaptive temporal weighting allows the model to dynamically modulate its memory horizon based on event significance.
Calibration Against Concept Drift
The decay rate λ is a direct lever for managing temporal bias-variance tradeoff. A fast decay (high λ) creates a model highly responsive to new fraud patterns but prone to noise and false positives. A slow decay (low λ) provides stability but risks concept drift blindness, where the model fails to adapt to shifting criminal tactics. Optimal calibration often involves monitoring the half-life of predictive power—the period over which historical features remain statistically significant for predicting current fraud labels.
Frequently Asked Questions
Explore the mathematical foundations and practical applications of time-decay functions in financial fraud detection, covering how they weight recent behavior more heavily to improve anomaly sensitivity.
A time-decay function is a mathematical formula that assigns exponentially or inversely decreasing weights to older observations in a temporal sequence, ensuring that recent data points exert greater influence on a model's current state or prediction. The core mechanism involves multiplying each observation by a decay factor ( \lambda ) (where ( 0 < \lambda < 1 )) raised to the power of its age. For a transaction occurring ( t ) time steps ago, its weight is ( w_t = \lambda^t ). This directly operationalizes the intuition that a user's most recent transactions are far more indicative of their current behavioral intent than those from months prior. In temporal transaction modeling, this function is applied to feature aggregation windows, exponentially weighted moving averages (EWMA), and the loss functions of recurrent neural networks to prioritize learning from recent patterns. The decay rate ( \lambda ) is a critical hyperparameter: a value close to 1 creates a slow, gradual decay suitable for stable user profiles, while a value near 0 creates a sharp decay ideal for detecting rapid behavioral shifts indicative of account takeover.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Core concepts that interact with or form the mathematical foundation for time-decay functions in temporal sequence modeling for fraud detection.
Exponential Smoothing
A foundational forecasting method that applies decreasing weights to past observations, directly implementing a time-decay principle. The ETS framework models error, trend, and seasonality components to establish a dynamic baseline for expected transaction behavior. The smoothing parameter α controls the decay rate, with values closer to 1 giving more weight to recent observations and values closer to 0 distributing weight more evenly across the series.
Transaction Velocity
A derived feature measuring the rate of transactions over a specific time window, such as login attempts or payment transfers per minute. Time-decay functions are critical here because a simple count over a fixed window creates artificial discontinuities at window boundaries. A decay-weighted velocity applies exponential or inverse weighting to events within the window, producing a smoother, more responsive signal that is a critical real-time indicator of automated bot attacks or account takeover.
Hawkes Process
A self-exciting temporal point process where the occurrence of an event increases the probability of future events in the near term. The excitation function typically includes an exponential decay kernel of the form αe^(-βt), where α controls the magnitude of self-excitation and β governs the decay rate. This directly models bursty behavior in financial transactions or high-frequency trading, where a rapid sequence of small transactions may precede a large fraudulent one.
Concept Drift
The phenomenon in streaming data where the underlying statistical relationship between input features and the target variable changes over time. Time-decay functions serve as a mitigation strategy by continuously down-weighting obsolete patterns. In adaptive learning contexts, a decay factor on historical loss contributions ensures the model prioritizes recent data distributions, preventing it from being anchored to outdated fraud patterns that adversaries have already abandoned.
Sequence Anomaly Score
A scalar value quantifying the abnormality of an entire sequence of events, derived from the reconstruction error of an autoencoder or the negative log-likelihood of a sequence model. Time-decay weighting is often applied when aggregating per-event anomaly scores into a session-level score, ensuring that suspicious activity at the end of a session contributes more to the final risk assessment than ambiguous signals at the beginning. This temporal prioritization reduces false positives from stale signals.
Cumulative Sum (CUSUM) Control Chart
A sequential analysis technique that accumulates deviations from a target mean over time, triggering an alert when the cumulative sum exceeds a threshold. While standard CUSUM uses uniform weighting, decay-enhanced CUSUM variants apply a forgetting factor to the accumulated sum, making the statistic more sensitive to recent shifts and preventing saturation from historical noise. This makes it highly sensitive to small, sustained shifts in transaction behavior that emerge gradually.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us