Two-Threshold Edges: Stopping Neighbor Flicker in Streaming Graph Models

Many graph neural networks decide at every step which nodes count as a node's neighbors, then weight those neighbors by how relevant they look. Examples include a pedestrian-forecasting model that links agents who are close to each other, or a point-cloud model that links points that are close in a learned feature space. When a neighbor sits right at the cutoff, whether "the k-th nearest" or "within radius r", tiny changes in its position or features flip the edge on and off from one frame to the next. The model's output then flickers with it. Control engineers have a standard fix for this kind of on-off chatter, called hysteresis: use a strict threshold to switch something on and a looser one to switch it off, so that small wobbles near the boundary cannot toggle the state. We propose giving every edge in a streaming graph model this two-threshold memory, with thresholds calibrated against an explicit edge-churn budget. The goal is predictions that stop flickering while still reacting immediately when a new neighbor becomes relevant.

The central bet is about asymmetry. The obvious fix for jitter is to smooth edge weights over time with a moving average. Smoothing, however, delays edges symmetrically: a newly dangerous neighbor fades in just as slowly as a departed one fades out. Hysteresis can add an edge the instant its score crosses the strict entry threshold and still refuse to drop it until the score has clearly moved past the exit threshold. In multi-agent forecasting, keeping a departing agent a few frames too long costs little, while noticing an approaching one a few frames late is what causes errors. We test whether this asymmetry, rather than smoothing as such, is what matters. We also include the ablation that could show a cheaper continuous version does just as well.

Core Claim

Consider a streaming model that rebuilds its neighbor sets at every timestep and then applies attention over them. Our claim is that replacing the memoryless edge rule with a per-edge hysteresis state will reduce edge churn and frame-to-frame prediction flicker substantially, without increasing displacement error. It should also enter new interactions faster than symmetric temporal smoothing tuned to the same flicker level. Concretely, let $d_{ij}(t)$ be the score that decides whether agent $j$ is a neighbor of agent $i$ at time $t$, such as distance in position or feature space. Let $s_{ij}(t)\in\{0,1\}$ be the edge's on/off state. The rule is

$$ s_{ij}(t)=\begin{cases}1 & \text{if } s_{ij}(t-1)=0 \text{ and } d_{ij}(t)<\tau_{\text{in}},\\ 0 & \text{if } s_{ij}(t-1)=1 \text{ and } d_{ij}(t)>\tau_{\text{out}},\\ s_{ij}(t-1) & \text{otherwise,}\end{cases} $$

where $\tau_{\text{in}}\le\tau_{\text{out}}$ are the entry and exit thresholds. Attention weights are then computed only over edges with $s_{ij}(t)=1$, exactly as in the base model. When $\tau_{\text{in}}=\tau_{\text{out}}$, the rule reduces to today's single-threshold graph construction. That equality case is the key ablation.

Relation to Prior Work

The hysteresis side supplies the mechanism. ThriftyDAgger gates robot-to-human control handoffs with stricter criteria for returning control than for requesting help. It sets its thresholds from quantiles of visited states so as to meet a human-intervention budget. We reuse that calibration idea, but apply it to a per-edge churn budget instead of a single scalar risk signal. AutoReP shows that discrete on/off switches updated by continuous signals oscillate unless a hysteresis buffer separates the forward and reverse flips. It does this for choosing which activations to replace inside convolutional networks, never for graph edges. Lanza et al. enforce a minimum dwell time after a safety filter activates, and Raj et al. combine voting windows with hysteresis to arbitrate between planners. Dwell time is the natural competing design, so we test it directly. All of these work on one scalar signal per system. None faces thousands of simultaneous edges whose on/off states feed a learned aggregator, which the research file identifies as a missing graph formulation.

The neighbor-weighting side supplies the application and the evidence that a gap exists. Dynamic Graph CNN recomputes a hard k-nearest-neighbor graph from learned features at every layer, with no memory of which edges existed before. GATraj weights interacting agents with attention from instantaneous states, with nothing to stop attention from hopping between competing neighbors across frames. AdaptViG avoids hard cutoffs by gating edges with a smooth exponential decay of feature distance. This removes the discontinuity but not the dependence on the current instant, so a neighbor's weight still wobbles whenever its distance wobbles. We treat that as a strong baseline rather than a solved problem. GCE computes attention-like Boltzmann-Gibbs neighbor weights for multi-object control and relies on the smoothness of its kernel embedding to tolerate noise. It is the natural second testbed.

One paper constrains the proposal. The Temporal Graph Benchmark finds that a plain moving average beats TGN on node affinity prediction, 0.559 versus 0.315 NDCG@10 on tgbn-reddit. This shows that temporal inertia is valuable. It also warns that the simplest form of inertia may be enough, which is why symmetric and asymmetric moving averages are the baselines we most need to beat.

Research Program

We build the hysteresis edge rule as a drop-in replacement for the neighbor-construction step of a forecasting model that operates frame by frame. The main backbone is a GATraj-style model with an explicit interaction graph, using k-nearest agents or a radius, rebuilt every frame. In streaming mode, the model re-predicts every agent's future trajectory at each new observation.

We calibrate thresholds in two ways. The first is quantile calibration in the style of ThriftyDAgger. We set $\tau_{\text{in}}$ to the entry quantile the base model uses, then choose $\tau_{\text{out}}$ as the smallest exit threshold whose edge churn on training streams falls below a target budget. This makes churn an explicit dial. The second learns both thresholds end to end, using a straight-through gradient through the on/off state, with a churn penalty added to the forecasting loss. Because edges can only persist, never appear early, the rule adds no entry latency by construction. What it does add is exit latency. We bound this with an optional maximum hold time, so that an edge whose score has exceeded $\tau_{\text{out}}$ by a large margin is dropped immediately.

The analysis has two parts. We separate the effect of discreteness from that of asymmetry by comparing against an asymmetric moving average, which rises quickly and decays slowly. We also measure where forecast errors concentrate: near-boundary agents, newly arriving agents, and dense scenes.

A secondary study ports the same rule to the stochastic multi-object environments of GCE, which are the rope, soft robot, swimmer, and power grid. There we ask whether stabilizing the interaction graph improves control under the observation noise at which GCE's baselines diverge.

Baselines

The naive reference point is the base forecasting model with its interaction graph rebuilt from scratch every frame by a single threshold. This is today's behavior, and in our rule it is the case $\tau_{\text{in}}=\tau_{\text{out}}$. It isolates the key ingredient: any gain from hysteresis must appear against this model with everything else held fixed.

The strongest existing method on the accuracy axis is GATraj, which reports an average displacement error of 0.17 m and a final displacement error of 0.29 m on ETH/UCY, at about 10 ms per inference on nuScenes. We first reproduce its standard single-shot evaluation to confirm our implementation matches these numbers, then run it in streaming mode. Beating it means matching its displacement error within run-to-run variance while clearly reducing flicker and churn. A win on flicker that costs displacement error does not count.

The strongest competitor on the stability axis is temporal smoothing. We run a symmetric exponential moving average over edge weights, and a soft exponential-decay gate in the style of AdaptViG with and without that averaging. We also run a dwell-time rule following Lanza et al., where an edge, once on, stays on for a fixed number of frames. For a fair comparison, every smoothing method gets the same number of tuning trials for its stability parameter on the same validation streams, with the same backbone weights and compute. We then compare all methods at matched flicker levels, reporting displacement error and entry latency at each level rather than at a single hand-picked setting.

The final baseline is the asymmetric moving average, which rises fast and decays slowly. It is our ablation for "asymmetry without discreteness." If it matches hysteresis on all metrics, the honest conclusion is that asymmetry is what matters. The discrete version would then earn its place only through sparsity and cached messages, which we measure separately as wall-clock time.

Why not just…?

Why not just smooth the edge weights with a moving average? The TGB result shows that smoothing is a formidable baseline, so this is a real threat. The specific weakness we expect is symmetric lag. Tuned to suppress flicker, a moving average also delays the appearance of a newly approaching agent. The entry-latency metric, compared at matched flicker, settles this directly. If symmetric smoothing shows no worse entry latency than hysteresis on nuScenes, where agents enter and leave neighborhoods constantly, our central argument fails.

Why not just use smooth distance-decay gating so there is no hard cutoff to chatter across? AdaptViG's gate removes the jump, but a neighbor hovering at the boundary still sees its weight wobble frame by frame, because the gate has no memory. It was also designed for static images, not streams. We measure the frame-to-frame variance of attention weights for boundary neighbors under the soft gate. If that variance is already negligible, and flicker matches the hysteresis model, the soft gate wins on simplicity and we will say so.

Why not just connect every agent to every other and let attention sort it out? In small ETH/UCY scenes, full connectivity is cheap, and this may genuinely erase the problem there, because no hard boundary exists. Two things limit it. Softmax attention over many competing agents can still hop between them across frames, and the cost grows quadratically with scene density, a limitation that Dynamic Graph CNN and AdaptViG both note. We therefore include the fully connected model as a baseline, report attention-hopping and latency as a function of agent count, and expect the case for hysteresis to rest on dense nuScenes scenes rather than on ETH/UCY.

Proposed Experiments

The primary benchmarks are ETH/UCY and nuScenes in streaming mode. The metrics are average and final displacement error in meters, edge churn (the fraction of edges toggled per frame), and prediction flicker, defined as the mean distance between successive predictions for the same future timestamp. We also report entry latency, the frames between an agent entering the ground-truth interaction zone and its edge becoming active, along with inference time.

The first decisive check is the matched-flicker comparison. At each flicker level, hysteresis should show equal displacement error and lower entry latency than symmetric smoothing and dwell time. The second is the $\tau_{\text{in}}=\tau_{\text{out}}$ ablation, which should reproduce the base model's flicker exactly and so confirm that the gap comes from the threshold separation. The third is the asymmetric moving-average comparison described above, which decides whether discreteness adds anything beyond asymmetry. The fourth is a boundary-stratified error analysis. Gains should concentrate on agents whose distance hovers near the cutoff. If gains appear uniformly across all agents, something other than de-chattering is responsible.

In the secondary study on GCE's environments, the question is whether the hysteresis-stabilized interaction graph keeps control error at or below GCE's reported 0.41 on the swimmer as observation noise rises. GCE reports staying stable at 20% noise on the power grid, while several baselines fail at 5%. We will test whether stabilizing its interaction weights extends that margin. For TGB node affinity, we will attempt only one experiment: applying the rule to TGN's temporal neighbor retrieval on tgbn-reddit. We do not expect to close the gap to the moving average's 0.559 and treat this as a probe of how much inertia the neighbor set alone can supply.