---
title: Penalty-Based Attention Optimization
url: https://www.emergentmind.com/topics/penalty-based-attention-optimization
type: topic
---

# Penalty-Based Attention Optimization

Searching arXiv for recent and directly relevant papers on penalty-based attention optimization.
Penalty-based attention optimization denotes a family of methods in which penalties, regularizers, or reward terms are used to determine attention distributions, reshape existing attention maps, condition the attentional behavior learned by an agent, or use attention itself for fine-grained penalty assignment. In the arXiv literature, this includes simplex-regularized attention mappings such as softmax, sparsemax, fusedmax, and oscarmax [1705.07704]; the Focal Distance Penalty Term and Focal exponents applied to Squeeze-and-Excitation blocks and Attention Gates in biomedical segmentation [2111.00534]; reward-conditioned analysis of cross-attention in Perceiver-based autonomous driving agents [2606.25127]; and ATTNPO, where intrinsic attention signals are used for step-level attenuation of reinforcement-learning advantages in reasoning models [2602.09953].

## 1. Convex formulations of attention with explicit penalties

A canonical formulation seeks a differentiable surrogate to the non-differentiable hard $\arg\max$ on scores $z\in\mathbb R^n$. Let $\Delta^n=\{p\in\mathbb R^n:\sum_i p_i=1,\;p_i\ge0\}$ be the probability simplex, let $\Omega:\Delta^n\to\mathbb R$ be a convex, $\beta$-strongly convex penalty, and let $\gamma>0$ be a temperature or regularization parameter. The smoothed max operator is defined as
\[
\omega_\Omega(z)\;=\;\max_{p\in\Delta^n}\;\Bigl\{\,p^Tz\;-\;\gamma\,\Omega(p)\Bigr\},
\]
with attention mapping
\[
p^*(z)\;=\;\arg\max_{p\in\Delta^n}\{\,p^Tz-\gamma\,\Omega(p)\}
\;=\;\nabla_z\,\omega_\Omega(z).
\]
By strong convexity of $\Omega$, $\omega_\Omega$ is smooth and $p^*(z)$ is $\tfrac1{\gamma\beta}$-Lipschitz [1705.07704].

This formulation recovers several standard and nonstandard attentions as special cases. With $\Omega(p)=\sum_i p_i\log p_i$, one obtains softmax:
\[
\omega_\Omega(z)=\gamma\log\sum_i e^{z_i/\gamma},\qquad
p^*_i(z)=\frac{e^{z_i/\gamma}}{\sum_j e^{z_j/\gamma}}.
\]
With $\Omega(p)=\tfrac12\|p\|_2^2$, one obtains sparsemax as Euclidean projection onto the simplex:
\[
p^*(z)=\argmin_{p\in\Delta^n}\bigl\|p-\tfrac1\gamma z\bigr\|_2^2
=\Pi_\Delta(z/\gamma).
\]
The squared $p$-norm max, with $\Omega(p)=\tfrac12\|p\|_p^2$ for $1<p\le2$, yields a continuum between soft and hard sparsity [1705.07704].

The significance of this framework is that the penalty is not an auxiliary training heuristic but part of the definition of the attention map itself. In this setting, the choice of $\Omega$ directly specifies whether the resulting attention is dense, sparse, contiguous, or clustered.

## 2. Structured penalties, differentiation, and empirical behavior

Structured penalties extend the simplex-regularized construction beyond sparsity alone. Fusedmax uses
\[
\Omega(p)=\tfrac12\|p\|_2^2+\lambda\sum_{i=1}^{n-1}|p_{i+1}-p_i|,
\]
which induces a contiguity prior and yields
\[
p^*(z)
=\argmin_{p\in\Delta^n}
\frac12\bigl\|p-z/\gamma\bigr\|_2^2
+\lambda\sum_i|p_{i+1}-p_i|.
\]
Oscarmax uses
\[
\Omega(p)=\tfrac12\|p\|_2^2+\lambda\sum_{i<j}\max(|p_i|,|p_j|),
\]
which induces a clustering prior and produces plateaued outputs across arbitrary positions [1705.07704].

The implementation problem is twofold: compute the forward map $p^*(z)$ and compute Jacobian information for backpropagation. The forward pass is closed form for softmax, uses sort-and-threshold or expected linear-time projection for sparsemax, uses Condat’s $O(n)$ TV-prox followed by simplex projection for fusedmax, and uses approximate OSCAR prox plus simplex projection for oscarmax. For general $\Omega$, projected-gradient methods such as FISTA can be used on $\Delta$ [1705.07704].

For the backward pass, the general Jacobian is characterized through
\[
A = J_{\Pi_\Delta}\bigl(y^*-\gamma\nabla\Omega(y^*)+z\bigr),\quad
B = \gamma\,H_\Omega(y^*),
\]
with
\[
\bigl(I + A\,(B-I)\bigr)\,J \;=\;A.
\]
Sparsemax admits the explicit Jacobian
\[
J_{ij}
=\frac1\gamma\Bigl(\delta_{ij}s_i\;-\;\frac{s_i s_j}{\|s\|_1}\Bigr),
\]
where $s_i=\mathbf1\{y^*_i>0\}$. For fusedmax and oscarmax, the Jacobian depends on index-groups of fused or clustered elements sharing the same output [1705.07704].

These penalties have clear theoretical consequences. $\omega_\Omega(z)=\bigl[\gamma\Omega+\iota_\Delta\bigr]^*(z)$ is convex in $z$; strong convexity implies differentiability; and sparsemax and squared-$p$-norm-max produce exact zeros, while fusedmax produces contiguous blocks of equal weight and oscarmax clusters positions into plateaus. Empirically, replacing softmax with sparsemax, fusedmax, oscarmax, or squared-$p$-norm-max was evaluated on textual entailment, machine translation, and sentence summarization. On SNLI, test accuracy was $81.66\%$ for softmax, $82.39\%$ for sparsemax, $82.41\%$ for fusedmax, and $81.76\%$ for oscarmax. In neural machine translation across 10 language pairs in OpenNMT-py, BLEU differences were within approximately one point of the best. On DUC-2004 summarization, fusedmax achieved $R$-1 $28.42$, $R$-2 $9.96$, and $R$-$L$ $25.55$, outperforming the reported softmax baseline of $27.16/9.48/24.47$ [1705.07704].

## 3. Focal penalties in biomedical segmentation losses and attention modules

A distinct line of work uses penalty terms to optimize both the loss function and the network’s internal gating behavior. In "Focal Attention Networks," the Unified Focal loss is
\[
\mathcal{L}_{\mathrm{UF}}
= \lambda\,\mathcal{L}_{\mathrm{AF}}
+ (1-\lambda)\,\mathcal{L}_{\mathrm{AFT}},
\]
and the Focal Distance Penalty Term is introduced as
\[
\mathcal{W}_{c}^{\mathrm{FDPT}}
=
\bigl(\mathcal{W}_{c}^{\mathrm{DPT}}\bigr)^{\epsilon}.
\]
Replacing per-pixel ground-truth weights in both AF and AFT by FDPT yields $\mathcal{L}_{\mathrm{AF\mbox{-}FDPT}}$, $\mathcal{L}_{\mathrm{AFT\mbox{-}FDPT}}$, and the extended objective
\[
\mathcal{L}_{\mathrm{UF+FDPT}}
= \lambda\,\mathcal{L}_{\mathrm{AF\mbox{-}FDPT}}
+ (1-\lambda)\,\mathcal{L}_{\mathrm{AFT\mbox{-}FDPT}}.
\]
By varying $\epsilon$ from $0$ through $1$ to larger values, the formulation continuously interpolates boundary attention strength [2111.00534].

The same focal idea is inserted on the network side as an elementwise power on attention weights. For a Squeeze-and-Excitation block, if
\[
s = \sigma\bigl(W_2 \,\mathrm{ReLU}(W_1\,z)\bigr),
\]
the Focal SE modification is
\[
s_f = s^f,\qquad X'_{c,:,:}=s_{f,c}X_{c,:,:}.
\]
For an Attention Gate,
\[
\alpha_i = \sigma\bigl(\psi^T\mathrm{ReLU}(W_x x_i + W_g g_x + b)\bigr),
\]
and the Focal AG modification is
\[
\alpha_{i,f}=\alpha_i^f,\qquad y_i=\alpha_{i,f}x_i.
\]
The paper gives the gradient link
\[
\partial L/\partial f = \sum_k \frac{\partial L}{\partial a_k^f}\,a_k^f\ln(a_k),
\]
which ties the trainable exponent in the network to the focal exponent in the loss [2111.00534].

The reported selection heuristic is explicitly dataset- and model-specific. On the loss side, an empirical grid search over $\epsilon\in\{0,0.1,1,10\}$ found $\epsilon=0.1$ gave the best validation Dice across all three datasets. On the network side, every Focal layer parameter $f$ is initialized to zero, the model is trained to convergence, the final value $f_p$ is recorded at each module position, and modules with $f_p<0.2$ are removed. In the reported SE experiments, this retained $2$ of $9$ blocks on DRIVE, $4$ of $9$ on 2018DSB, and $5$ of $9$ on CVC-ClinicDB [2111.00534].

The experimental setting is tightly specified: DRIVE uses $40$ images of size $512\times512\times3$ with split $16/4/20$; 2018DSB uses $670$ images of size $256\times256\times3$ with split $428/108/134$; and CVC-ClinicDB uses $612$ images of size $288\times384\times3$ with split $392/98/122$. Reported loss hyperparameters are $\lambda=0.5$, $\delta=0.6$, dataset-specific $\gamma$ values of $0.1$, $0.2$, and $0.3$, and FDPT exponent $\epsilon=0.1$. Training uses Adam with learning rate $1\times10^{-3}$, ReduceLROnPlateau with patience $25$ and factor $0.1$, EarlyStopping with patience $50$, instance normalization, Xavier initialization, and batch size $1$; evaluation metrics are Dice Similarity Coefficient, Precision, and Recall [2111.00534].

Quantitatively, the loss-only ablation reported that U-Net with DSC gave approximate DSC values of $0.8082$, $0.9147$, and $0.8826$ on DRIVE, 2018DSB, and CVC respectively; UFL improved these to $0.8142/0.9157/0.8937$; UFL + DPT with $\epsilon=1$ did not always help; and UFL + FDPT with $\epsilon=0.1$ gave $0.8155/0.9165/0.8993$. For channel attention, Focal USE-Net after module selection gave DRIVE DSC $0.8159$ with only $2$ SE blocks, 2018DSB DSC $0.9179$ with $4$ SE blocks, and CVC DSC $0.8952$. For spatial attention, Focal AG with module selection improved performance on 2018DSB and CVC; the reported CVC configuration with $2$ Focal AGs reached DSC $0.9118$ versus $0.8937$ for the plain U-Net baseline [2111.00534].

## 4. Reward-conditioned attention shaping in autonomous driving

In autonomous driving, penalty-based attention optimization has been studied as a property induced by reward design rather than by directly regularizing an attention layer. The Perceiver-based Soft Actor-Critic agent summarized in "Reward-Conditioned Attention" uses a Perceiver Latent-Query encoder with $280$ input tokens partitioned into $5$ ego, $40$ other-agents, $200$ road-graph, $25$ lights, and $10$ GPS waypoints, together with $16$ learned latent queries, one cross-attention layer with $16$ queries and $2$ heads of size $d_k=16$, and four layers of latent self-attention. Cross-attention weights at time $t$ are
\[
A^t = \mathrm{softmax}((QK^T)/\sqrt{d_k}) \in \mathbb R^{n_{\mathrm{heads}}\times n_{\mathrm{queries}}\times n_{\mathrm{tokens}}},
\]
after which attention is averaged over heads and queries to obtain a single $280$-vector and summed into five semantic categories: ego, agents, road graph, lights, and GPS [2606.25127].

The scalar reward is decomposed into violation penalties, a continuous proximity penalty, and a navigation reward. The safety-critical hard penalties are
\[
R^t_v = -I[\mathrm{collision}_t]\cdot C_{\mathrm{coll}}
- I[\mathrm{offroad}_t]\cdot C_{\mathrm{off}}
- I[\mathrm{red\mbox{-}light}_t]\cdot C_{\mathrm{red}}.
\]
The continuous time-to-collision penalty is
\[
R^t_p = -\alpha\cdot \max(0,1-\mathrm{TTC}_t/\tau),
\]
with $\tau=1.5\,\mathrm{s}$. The navigation term is
\[
R^t_n = +\beta\cdot I[\mathrm{progress}_t>\mathrm{progress}_{t-1}] - \gamma\cdot I[\mathrm{offroute}_t].
\]
From these components, the paper defines
\[
r_t^{\mathrm{basic}}=R_v^t,\qquad
r_t^{\mathrm{minimal}}=R_v^t+R_n^t,\qquad
r_t^{\mathrm{complete}}=R_v^t+R_n^t+R_p^t.
\]
The central measurement issue is attention–risk coupling. Collision risk is
\[
\mathcal R_t=\mathrm{clip}(1-\min_j \mathrm{TTC}_{j,t}/3.0,\,0,\,1)\in[0,1],
\]
and for episode $i$ the reported statistic is the within-episode Spearman correlation
\[
\rho_i=\rho_{\mathrm{spearman}}(\{\mathcal R_t\},\{a_{\mathrm{agent},t}\}).
\]
Aggregation uses Fisher’s $z$ transform,
\[
z_i=\tfrac12\ln\frac{1+\rho_i}{1-\rho_i},\qquad
\bar z=\frac1n\sum_i z_i,\qquad
\bar\rho=\tanh(\bar z),
\]
which is reported to control for between-scenario baseline heterogeneity and to yield tight confidence intervals on $\bar\rho$ [2606.25127].

Across $50$ real-world scenarios from the Waymo Open Motion Dataset, the episode-average GPS-path attention was $7.1\%$ for the basic configuration, $16.4\%$ for the complete configuration, and $33.5\%$ for the minimal configuration. The reported ratios are $2.0\times$ more GPS attention for minimal versus complete, and $4.7\times$ more for minimal versus basic. Baseline attention to the "Other Agents" category was $4.2\%$ for the minimal model and $5.6\%$ for the complete model, corresponding to a $1.3\times$ higher surveillance prior with the TTC penalty. Under high-risk phases with $\mathcal R>0.7$ in the $16$ most risk-reactive scenarios, complete-model agent attention increased from $3.9\%$ to $6.8\%$, a $+76.7\%$ relative increase, while the minimal model increased from $2.5\%$ to $4.6\%$, a $+89.1\%$ increase. In calm phases with $\mathcal R<0.2$, the complete model maintained on average $+151\%$ more agent attention than the minimal model, with the gap appearing from $t=0$ and persisting through collision-free periods; this pattern is described as a learned vigilance prior [2606.25127].

The same study reports that naïve pooling of timesteps across episodes substantially underestimates the attention–risk relationship, and that within-episode correlation with Fisher $z$ aggregation is the appropriate statistic. It also reports that in several scenarios the complete-reward and minimal-reward models exhibit opposite attention–risk correlation directions, showing that reward design can qualitatively reverse attentional strategy rather than merely modulating its magnitude. For tuning, approximate linearity of baseline agent attention with $\alpha$ was observed in the range $[0.1,0.3]$:
\[
a_{\mathrm{agent}}^0(\alpha)\approx A_0+m\alpha,
\]
with $A_0\approx3.0\%$ and $m\approx13\%$ per unit $\alpha$, implying
\[
\alpha^*\approx(a^*-A_0)/m
\]
for a desired resting agent attention $a^*$. Increasing $C_{\mathrm{coll}}$ from $1$ to $2$ raised the within-episode $\rho(\mathrm{agent})$ by approximately $1.5\times$ [2606.25127].

## 5. Attention-guided step-level penalties in reasoning reinforcement learning

In ATTNPO, penalty-based attention optimization does not define the attention map and does not directly alter the model’s attention weights. Instead, attention is mined to produce step-level credit assignment within reinforcement learning with verifiable rewards. Chain-of-thought generation is treated as an episodic MDP $(M,S,A,T,R)$ in which the state is $s_t=(q,o_{<t})$, the action is the next token $a_t\in V$, transitions are deterministic, and reward is assigned only at episode end after a special `</think>` marker plus final solution $F$. For rollout $i$, the reported terminal reward is
\[
r_i=\mathbf1[o_i\ \mathrm{correct}]\cdot(1-\alpha\cdot\sigma(f(o_i))),
\qquad
f(o_i)=\sigma((|o_i|-\mu_q)/\sigma_q),
\]
with $|o_i|$ the total token length and $\mu_q,\sigma_q$ the empirical mean and standard deviation of lengths of correct rollouts for question $q$. The policy objective is
\[
J(\theta)=E_{q\sim P,\,o\sim\pi_\theta}[r(o)].
\]
Training uses an outcome-supervised, critic-free PPO-style surrogate with group-leave-one-out advantage
\[
A^i=r_i-\frac1{G-1}\sum_{j\ne i}r_j
\]
and tokenwise importance ratio
\[
\rho_{i,t}=\frac{\pi_\theta(o_{i,t}\mid s_{i,t})}{\pi_{\theta_{\mathrm{old}}}(o_{i,t}\mid s_{i,t})},
\]
leading to
\[
L_{\mathrm{PG}}(\theta)=E_{q,i,t}\Bigl[\min(\rho_{i,t}A^i,\mathrm{clip}(\rho_{i,t},1-\epsilon,1+\epsilon)A^i)\Bigr],
\]
together with a small KL penalty $-\beta D_{\mathrm{KL}}(\pi_\theta\Vert\pi_{\mathrm{ref}})$ [2602.09953].

The central idea is to identify transformer heads that naturally focus on essential steps while suppressing redundant ones. Using a probing set whose intermediate steps are manually labeled essential or redundant, the paper defines for head $(\ell,h)$ and step $s_k$
\[
S^{\ell,h}_{s_k} = \frac1{|s_k|}\sum_{m\in F}\sum_{n\in s_k} a^{\ell,h}_{m\to n},
\]
and evaluates each head by Step-Ranking Accuracy,
\[
\mathrm{SRA}_{\ell,h}
=
\frac{\#\{(s^+\in E_s,\,s^-\in R_s): S^{\ell,h}_{s^+} > S^{\ell,h}_{s^-}\}}{|E_s|\cdot|R_s|}.
\]
A small subset of top-$N$ heads with $\mathrm{SRA}\approx0.9$–$0.95$ is selected as Key-Focus Heads. At training time, a rollout is segmented into steps, KFH scores are averaged,
\[
\mathcal S^i_{s_k}=\frac1N\sum_{(\ell,h)\in\mathrm{KFHs}} S^{\ell,h}_{s_k},
\]
and compared against a baseline
\[
\mathcal S^i_{\mathrm{base}} = p_i^\beta\cdot(|F_i|/|o_i|),
\]
where $p_i=(1/G)\sum_j \mathbf1[o_j\ \mathrm{correct}]$. Steps with $\mathcal S^i_{s_k}\ge \mathcal S^i_{\mathrm{base}}$ are deemed essential and those below are deemed redundant [2602.09953].

The penalty enters through advantage rescaling. The step-level advantage is
\[
\hat A^i_{s_k}=\gamma^i_{s_k}\cdot A^i,\qquad \gamma^i_{s_k}\ge0.
\]
When $A^i>0$, positive-advantage attenuation is
\[
\gamma^i_{s_k}=
\begin{cases}
(1-\delta)\cdot p_i^\lambda\cdot(\mathcal S^i_{s_k}/\mathcal S^i_{\mathrm{base}})+\delta,
& \text{if }\mathcal S^i_{s_k}<\mathcal S^i_{\mathrm{base}}\text{ and } t>T\cdot p_i,\\
1,& \text{otherwise.}
\end{cases}
\]
When $A^i<0$, negative-advantage attenuation is
\[
\gamma^i_{s_k}=
\begin{cases}
0,& \text{if }\mathcal S^i_{s_k}>\mathcal S^i_{\mathrm{base}},\\
1,& \text{otherwise.}
\end{cases}
\]
The paper writes the corresponding explicit penalty view as
\[
R'(o)=r(o)-\sum_{k=1}^K (1-\gamma^i_{s_k})\cdot P(s_k),
\]
though in implementation the $\gamma^i_{s_k}$ are inserted directly into the policy-gradient surrogate. The modified objective is
\[
L(\theta)=E_{q,i,t}\Bigl[\min(\rho_{i,t}\hat A^i_{s_k},\mathrm{clip}(\rho_{i,t},1-\epsilon,1+\epsilon)\hat A^i_{s_k})\Bigr]
-\beta E_{q,i,t}\bigl[D_{\mathrm{KL}}(\pi_\theta(\cdot|s_{i,t})\Vert \pi_{\mathrm{ref}}(\cdot|s_{i,t}))\bigr].
\]
The algorithm is reported to introduce negligible extra cost because attention-based scores can be extracted during the usual forward pass [2602.09953].

The empirical study covers six in-domain math benchmarks—GSM8K, MATH500, AMC2023, OlympiadBench, AIME24, and AIME25—and three held-out OOD tasks—LiveCodeBench, GPQA-Diamond, and MMLU. Metrics are Pass@1 accuracy, average output length in tokens, and Average Efficiency Score. On the $1.5$B model, ATTNPO is reported to yield a $+7.3$ percentage-point absolute accuracy gain averaged over the six math sets versus vanilla RLVR with length penalty, $60\%$ shorter CoTs, and AES increases of approximately $10$–$20\%$ on every benchmark. On the $7$B model, the reported gains are $+2.9$ percentage points in accuracy and $55\%$ length reduction, with superior AES relative to prior outcome-supervised and process-supervised methods. Ablations show that positive-advantage attenuation alone collapses length by more than $50\%$ but loses some accuracy, adding negative-advantage attenuation recovers accuracy while preserving brevity, performance saturates steeply at about $N\approx3$ KFHs, removing difficulty-aware terms leads to larger accuracy degradation, and omitting the schedule $t>T\cdot p_i$ causes premature collapse on hard problems. On OOD code and science tasks, outputs are shortened by $15$–$40\%$ while accuracy is matched or slightly improved, and Pass@$k$ analysis indicates retained exploration capacity [2602.09953].

## 6. Comparative interpretation and diagnostic significance

Across these works, the phrase penalty-based attention optimization refers to distinct intervention points rather than a single algorithm. In the simplex-regularized framework, the penalty $\Omega$ is part of the variational definition of the attention mapping itself, and properties such as sparsity, contiguity, and clustering follow from the chosen convex penalty [1705.07704]. In Focal Attention Networks, penalty terms appear both in the loss, via FDPT, and in the network, via trainable exponents on channel and spatial attention maps [2111.00534]. In autonomous driving, penalties are reward components whose content changes what a Perceiver encoder prioritizes, including GPS-path tokens and dynamic-agent tokens [2606.25127]. In ATTNPO, by contrast, attention is used as a process-supervision signal to determine where penalties or attenuations should be applied in policy optimization rather than being the immediate object of regularization [2602.09953].

Several recurring misconceptions are clarified by the reported results. First, penalty-based attention optimization is not synonymous with sparse attention. Sparsemax, fusedmax, and oscarmax are only one branch of the literature; other branches sharpen or smooth attention maps by exponentiation, induce a learned vigilance prior through continuous TTC penalties, or attenuate reinforcement-learning advantages at the step level rather than altering attention weights directly. Second, more attention is not uniformly better. The biomedical segmentation results explicitly report that some SE or AG placements hurt performance when forced everywhere, motivating focal module selection and the removal of modules with low learned focal parameters [2111.00534]. Third, coarse aggregation can be methodologically misleading. The autonomous-driving study states that naïve pooling of timesteps across episodes substantially underestimates the attention–risk relationship, and replaces it with within-episode Spearman correlation aggregated by Fisher $z$ [2606.25127]. Fourth, trajectory-level penalties need not provide adequate credit assignment. ATTNPO is explicitly motivated by the claim that uniform length penalties often fail to effectively shorten reasoning length and degrade accuracy because they treat all reasoning steps equally [2602.09953].

The combined record suggests a broader diagnostic role for attention analysis. The autonomous-driving results present attention analysis as a practical diagnostic for verifying that a reward function produces the intended representational behavior in safety-critical reinforcement learning, including checks on baseline attention and risk-reactive changes [2606.25127]. The segmentation work presents a modular focal paradigm that can be extended to per-pixel or per-region weighting schemes and to attention or gating mechanisms with $[0,1]$ weight maps, explicitly mentioning CBAM, concurrent spatial/channel SE, self-attention in Transformers, and graph attention, as well as instance segmentation, multi-task networks, and domain adaptation [2111.00534]. In the convex-attention setting, efficient forward and backward routines make structured penalties practical drop-in replacements for standard attention layers [1705.07704]. In reasoning RL, the same general pattern appears in a different form: intrinsic attention can supply zero-overhead stepwise supervision without external reward models or additional sampling [2602.09953].

Taken together, these studies establish penalty-based attention optimization as a technically heterogeneous but conceptually coherent program: penalties can define attentional distributions, transform their geometry, tune their sharpness, or make them a measurable proxy for whether an optimization objective is inducing the intended internal focus.

Source: https://www.emergentmind.com/topics/penalty-based-attention-optimization