Journal of Intelligence Science in Local Research
Online ISSN : 2759-1158
Hard-Negative Source Selection in Forward-Forward Learning on MNIST:
A Paired-Seed Confirmatory Study
白濵 成希
著者情報
ジャーナル オープンアクセス HTML

2026 年 3 巻 1 号 p. 66-77

詳細
Abstract

In supervised label-in-input Forward-Forward learning on MNIST, we tested the hard-negative source as the treatment contrast using 10 prespecified paired seeds and label-search classification error on a 5,000-example locked holdout. Condition A used exact label-search hard negatives for epochs 1-120. Condition B used the exact source for epochs 1-20, then a one-pass softmax source for epochs 21-120. Both conditions were evaluated using label-search classification. The mean locked-holdout error was 2.516% for Condition A and 2.878% for Condition B. The paired difference, defined as B minus A, averaged +0.362 percentage points; its two-sided 95% Student-t confidence interval was 0.159–0.565 percentage points. Because this interval lay entirely above zero, H1 was supported by the prespecified rule. Exact-source training therefore produced a lower mean error for the frozen design, but the result was restricted to its dataset partition, architecture, hyperparameters, schedules, seeds, and endpoint. No broader claims can be made based on this single prespecified comparison.

【Original article】

Hard-Negative Source Selection in Forward-Forward Learning on MNIST:

A Paired-Seed Confirmatory Study

Naruki Shirahama

Department of Data Science, Faculty of Data Science

Shimonoseki City University

Abstract

In supervised label-in-input Forward-Forward learning on MNIST, we tested the hard-negative source as the treatment contrast using 10 prespecified paired seeds and label-search classification error on a 5,000-example locked holdout. Condition A used exact label-search hard negatives for epochs 1-120. Condition B used the exact source for epochs 1-20, then a one-pass softmax source for epochs 21-120. Both conditions were evaluated using label-search classification. The mean locked-holdout error was 2.516% for Condition A and 2.878% for Condition B. The paired difference, defined as B minus A, averaged +0.362 percentage points; its two-sided 95% Student-t confidence interval was 0.159–0.565 percentage points. Because this interval lay entirely above zero, H1 was supported by the prespecified rule. Exact-source training therefore produced a lower mean error for the frozen design, but the result was restricted to its dataset partition, architecture, hyperparameters, schedules, seeds, and endpoint. No broader claims can be made based on this single prespecified comparison.

Keywords:

Forward-Forward algorithm, MNIST, hard-negative generation, label-search, confirmatory experiment, paired-seed design

1. Introduction

The Forward-Forward (FF) algorithm was proposed by Hinton (2022) as an alternative method for training neural networks using separate forward passes on positive and negative data and local layer objectives. Rather than propagating an end-to-end error derivative through the network, each layer is trained to assign greater goodness to positive inputs and lower goodness to negative inputs. This study concerns one specific supervised use of that framework: label-in-input learning for handwritten-digit classification on the MNIST dataset (LeCun et al., 1998). It does not attempt a broad comparison between FF and backpropagation or a general evaluation of FF variants.

In the label-in-input FF, a candidate class is encoded into the designated input positions. During evaluation, exact label-search inference constructs each possible image-label combination, passes those candidates through the FF network, and chooses the label with the largest aggregate goodness score. A learned one-pass softmax head provides an approximation based on a single neutral-label pass through the network. The approximation can also be used during training as a source of hard-negative labels; for each example, it proposes the highest-scoring incorrect class. This creates a practical treatment choice, even when the final performance is evaluated using an exact label search. The choice of hard-negative source may influence which negative examples are presented to the local objectives while leaving the remaining architecture and training settings unchanged.

Our earlier study (hereafter, Paper 1; Shirahama et al., 2026) was a Japanese tutorial/review-style replication of FF on MNIST and an adaptive hyperparameter search log. It reported exploratory observations concerning label-search performance and suggested that approximating hard-negative selection with a one-pass source could worsen the label-search metric. Because the configurations and observations were developed adaptively, these results were only hypothesis-forming. They could motivate a focused question, but they could not provide a prospective confirmatory answer. Therefore, the present study does not translate or extend the Paper 1 experiment log. It tests one question afresh under a frozen protocol, deterministic class-stratified split, locked holdout, final-epoch evaluation, and paired-seed analysis.

Pairing was important because training variability could obscure the source contrast. Each of the 10 prespecified seeds was used once in each condition, with common stochastic streams matched within a pair as far as the implementation permitted. The seed, not an individual holdout image, was used as the inferential unit. Locking the holdout and analysis in advance also separated confirmatory evidence from prior exploratory exposure and prevented model, epoch, hyperparameter, condition, exclusion, or rerun selection based on primary outcomes.

The objective of this study is to determine, under a prespecified and condition-matched confirmatory protocol, whether the source used to select hard negatives during training affects final label-search generalization. The academic contribution is to isolate hard-negative source selection as a single training factor and to provide prospective paired-seed evidence for that factor while keeping the exploratory evidence from Paper 1 separate from the confirmatory analysis. Accordingly, the frozen research question was: “Does exact label-search-based hard-negative generation provide better label-search generalization than the one-pass softmax approximation when the remaining training conditions are held fixed?”

The frozen directional hypothesis H1 was: “Hard negatives selected by exact label search yield lower label-search error than hard negatives selected by the one-pass softmax approximation under otherwise matched training conditions.”

2. Background and Motivation

2.1 Forward-Forward learning and supervised label-in-input inference

An FF layer maps its input to a ReLU activation vector, denoted here by y l ( x ) . Its goodness is the summed squared activity

  
g l ( x ) = ∥ y l ( x ) ∥ 2 2 .

Local training raises the goodness of positive input-label combinations and lowers it for negative combinations relative to a threshold. Between local layers, the implementation used L2-only normalization: the activation vector was divided by its L2 norm plus 10-8, without mean subtraction, and the normalized result was detached before entering the next locally trained layer. This normalization is part of the frozen implementation rather than a claim that the alternative normalization procedures are unsuitable.

For supervised label-in-input learning, the image was flattened, and the first 10 input positions were replaced with the representation of a candidate class. The exact label search evaluates candidates 0 through 9. The score for a candidate is the sum of goodness over hidden layers 2 through 4; the first hidden layer is excluded from the inference score. The class with the highest score was predicted. This candidate enumeration is a label-search procedure used as the primary endpoint in both conditions.

The one-pass alternative first inserted a neutral label code, with all 10 label positions set to 0.1. It concatenates the pre-normalization ReLU activities from hidden layers 2 through 4 into 6,000 features and applies a learned 10-class linear softmax head. The present study used the one-pass head only as part of the frozen supervised FF configuration and, in Condition B, as the hard-negative source after calibration.

2.2 Hard-negative generation

Negative examples are required for the local FF objective. In the present supervised setting, a hard negative is formed by retaining the image but injecting an incorrect label selected to be challenging under a specified scoring criterion. The true class was excluded before selection. Under the exact label-search source, all candidate labels are scored using the FF goodness procedure, and the highest-scoring incorrect label is selected. Under the one-pass softmax source, the highest-logit incorrect label is selected from the neutral-label head.

These sources do not need to rank incorrect classes identically. Exact label search directly uses the layer goodness quantity, which also defines the primary label search evaluation, whereas the one-pass head learns a separate linear classification mapping from neutral-pass features. This difference makes the hard-negative source a scientifically meaningful training factor. It does not, by itself, establish which source is preferable, why any difference arises, or how either source performs as a final-inference method. These distinct questions require separate evidence.

Peer-reviewed FF research has examined the limitations and extensions of the original local-learning formulation. Lorberbom et al. (2024) addressed collaboration among layers. Papachristodoulou et al. (2024) identified negative data generation as a limitation and proposed a channel-wise competitive method that avoids explicit negative construction, while Chen et al. (2025) also treated negative data generation as a challenge in an unsupervised setting. Convolutional training, cascaded forward procedures, and spiking network applications further illustrate architectural and domain expansion (Scodellaro et al., 2025; Zhao et al., 2025; Ghader et al., 2026). Outside the FF, Robinson et al. (2021) placed hard-negative selection in the broader context of contrastive representation learning. None of these studies provide confirmatory evidence for the present hypothesis. This study asks a narrower question: when supervised explicit hard-negative training is retained, does changing only the source used to select an incorrect label alter the locked-holdout label-search error under the frozen design?

2.3 From exploratory replication to confirmatory question

Paper 1 replicated supervised FF learning on MNIST and adaptively explored the implementation and hyperparameter choices (Shirahama et al., 2026). Within that historical work, hard-negative generation emerged as a candidate source of discrepancy, and exploratory observations suggested worse label-search performance when hard-negative selection was approximated by a one-pass source. The earlier study was not designed as a locked, prospective test of the isolated contrast. Therefore, its official test observations and adaptive searches were excluded from the evidence analyzed in this study.

The present design converts only the unresolved question -not the earlier result- into a confirmatory comparison. It freezes the architecture, preprocessing, optimizers, hard-negative schedules, paired seeds, partition, endpoint, and decision rules. This separation is essential: Paper 1 supplies historical motivation and terminology, whereas the new locked-holdout paired-seed experiment supplies all confirmatory evidence and numerical results in this study.

3. Methods

3.1 Dataset, split, and preprocessing

We used 60,000 examples from the official MNIST training population (LeCun et al., 1998). A frozen split manifest deterministically partitioned this population, with class stratification, into 50,000 training examples, a 5,000-example validation reserve, and a 5,000-example locked confirmatory holdout. The split seed was 20260825. The three partitions were disjoint and exhaustive under manifestation. The validation reserve was not used for the confirmatory model, epoch, hyperparameter, condition, exclusion, or rerun selection. The official MNIST test set was not used in the present study for primary confirmation.

The images were converted to float32 values from 0 to 1 using ToTensor-equivalent preprocessing and flattened from 28 × 28 pixels to 784 values. The jitter was fixed at 0 pixels. For label-in-input processing, the first ten positions were replaced by the class code. A one-hot label was used for the labeled candidate passes, whereas a neutral pass replaced all 10 positions with 0.1.

3.2 Model and Forward-Forward learning configuration

The FF model contained four bias-enabled hidden layers, each with 2,000 units and ReLU activation. Goodness was the summed squared ReLU activity, with a threshold of θ=112. The L2-only interlayer normalization used an epsilon of 10-8, no mean subtraction, and detachment between locally trained layers. Peer normalization was enabled with a strength of 0.05 and a momentum of 0.99.

Each condition was trained for 120 epochs, with a batch size of 256. The FF model optimizer was SGD with a learning rate of 0.04, momentum of 0.9, and weight decay of 10-4. Hard negatives were enabled throughout the study. Training used the final state after epoch 120; there was no early stopping, model selection, epoch selection, hyperparameter search, or adaptive screening performed.

For each frozen seed, Python, NumPy, Torch CPU, and the available CUDA random generators were initialized before the Torch-heavy construction. Deterministic algorithms and deterministic cuDNN behavior were requested, cuDNN benchmarking was disabled, and the configured CUBLAS workspace setting was requested; any runtime limitations or warnings were retained in the provenance.

The one-pass feature was pre-normalized. Neutral-label pre-normalization ReLU activities from hidden layers 2 to 4 were concatenated into a 6,000-dimensional feature vector. The bias-enabled head was a 6,000-to-10 linear classifier trained by cross-entropy and SGD with a learning rate of 0.04, momentum of 0.9, and weight decay of 0.0. The head was part of both matched configurations; the experimental contrast concerned whether its output became a hard-negative source after the fixed calibration period.

3.3 Hard-negative source conditions

Condition A used the exact label-search hard-negative source during every epoch from 1 to 120. For each example, the true class was excluded, and the highest-scoring incorrect label under the exact label search was injected to construct a negative example.

Condition B used the exact label-search hard-negative source during epochs 1-20 and then the one-pass softmax hard-negative source during epochs 21-120. During the latter period, the true class was excluded before the largest one-pass head logit selected an incorrect label. The 20-epoch calibration period was prespecified and not tuned in the confirmatory study. All other frozen conditions were matched, as defined by the protocol. Thus, the treatment variable was the hard-negative source schedule rather than the evaluation procedure.

Within each minibatch, the neutral features, one-pass head logits, and hard-negative labels were determined from the pre-update model/head state. The one-pass head was updated first, the positive and already fixed negative labels were then injected, and the FF model was updated.

3.4 Label-search evaluation

For the primary evaluation, each possible label was injected in turn, and goodness was summed over hidden layers 2-4. The label with the highest aggregate score was predicted. This exact label-search evaluation was applied to the final epoch-120 checkpoint from both Condition A and Condition B. Consequently, Condition B's primary result is a label-search error obtained from a model whose later hard negatives came from the one-pass softmax source; it is not a “one-pass error.”

4. Confirmatory Experimental Design and Statistical Analysis

4.1. Paired-seed design and execution locking

The confirmatory comparison used 10 frozen seeds: 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, and 1010. Each seed was run once in Condition A and once in Condition B. Within a seed pair, initialization, training-example order, preprocessing, and other common stochastic streams were matched as far as the implementation permitted. The seed was the pairing and analysis unit of this study. The 5,000 locked-holdout examples in a cell were not treated as 5,000 independent inferential replicates.

The design allowed for no replacement seeds or post-outcome seed exclusion. All primary cells used the final epoch-120 state. No validation-based selection, early stopping, model selection, epoch selection, hyperparameter search, or adaptive screening was performed. The locked holdout remained separate from the training, and its evaluation occurred within the frozen evidence process after the condition-seed training cells were retained.

4.2 Primary endpoint

The primary endpoint was the locked-holdout label-search classification error percent, with N=5000 for each condition-seed cell:

  
e r r o r p e r c e n t = 100 × i n c o r r e c t l a b e l - s e a r c h p r e d i c t i o n s 5000 .

Both conditions used the same endpoints and evaluation procedures. Therefore, the primary contrast isolates the frozen hard-negative source schedule within the matched configuration.

4.3 Prespecified paired statistical analysis

For seed s, the paired difference was defined in percentage points as

  
d s = e r r o r B , s − e r r o r A , s .

A positive ds favors conditions A and H1. The analysis reports every condition-level value and paired difference, the mean and sample standard deviation for each condition, the mean and sample standard deviation of the paired differences, and a two-sided 95% Student’s t confidence interval for the mean paired difference. With 10 pairs, the confidence interval used 9 degrees of freedom and the two-sided 95% critical value t0.975,9=2.262. H1 was supported if the interval lay entirely above zero, inconclusive if it included zero, and rejected if it lay entirely below zero. No p-value, one-sided test, bootstrap procedure, Bayesian analysis, outlier removal, covariate adjustment, or relative improvement percentage was included in the prespecified analysis.

5. Results

5.1 Seed-level locked-holdout results

Table 1 lists all 10 prespecified pairs and presents the complete paired data rather than introducing an additional decision rule.

Table 1: Locked-holdout label-search classification error across paired-seeds.

Seed

Condition A

error (%)

Condition B

error (%)

B–A difference

(percentage points)

1001 2.64 2.88 0.24
1002 2.48 2.84 0.36
1003 2.26 2.48 0.22
1004 2.70 2.64 -0.06
1005 2.60 2.76 0.16
1006 2.50 3.42 0.92
1007 2.50 2.86 0.36
1008 2.60 2.82 0.22
1009 2.38 2.86 0.48
1010 2.50 3.22 0.72

Note: Condition A used exact label search hard-negative selection throughout epochs 1-120. Condition B used that source in epochs 1-20 and the one-pass softmax source in epochs 21-120. Both errors were measured by label-search inference, with N=5000 per condition-seed cell; the seed was the pairing unit. The mean±sample SD for Condition A was 2.516% ± 0.129%, and that for Condition B was 2.878% ± 0.268%. The mean paired B-A difference was 0.362 percentage points (two-sided 95% Student-t CI, 0.159–0.565 percentage points). Positive B-A values favor Condition A.

(Source: Created by the author)

5.2 Primary confirmatory inference

Across the 10 prespecified seed pairs, the mean locked-holdout label-search classification error was 2.516% (sample SD, 0.129%) for Condition A and 2.878% (sample SD, 0.268%) for Condition B.

The mean paired B-A difference was 0.362 percentage points (sample SD, 0.284 percentage points), with a two-sided 95% Student’s t confidence interval from 0.159 to 0.565 percentage points. Because the interval was entirely above zero, the prespecified decision rule classified H1 as being supported. These are locked holdout results, not official MNIST test results.

6. Discussion

6.1 Interpretation of the confirmatory result

Supported result. Under this frozen paired-seed MNIST design, Condition A produced a lower mean locked-holdout label-search error than Condition B. The positive mean paired B-A difference and its confidence interval support the directional hypothesis under the prespecified rule. The comparison concerns two hard-negative source schedules within one fixed implementation: exact label search throughout training versus a switch to the one-pass softmax source after 20 calibration epochs. Because both conditions were evaluated with label search, the result addressed the source of hard negatives during training and did not compare the final label-search inference with the final one-pass inference.

The paired design makes the scale and variability of the contrast explicit at the seed levels. This supports an inference about the mean paired difference over the prespecified seeds under this configuration. It does not turn the holdout images into independent experimental repetitions, nor does it establish that the observed effect will recur under other data, model families, training schedules or hyperparameters.

6.2 Relationship to the exploratory Paper 1 observations

This result is consistent with the historical motivation from Paper 1, where adaptive exploratory work identified the one-pass approximation to hard-negative selection as a possible contributor to worse label-search performance. Consistency does not retroactively make earlier observations confirmatory. Paper 1 used an exploratory workflow and included previously exposed official test observations; neither its numerical results nor its search history was pooled into the present table, confidence interval, or decision.

Therefore, the contribution of the present study is a prospective resolution of the frozen question for the specified MNIST setting. Paper 1 frames the unresolved issue, and the present study supplies a new condition-matched, locked-holdout comparison. Keeping these roles distinct avoids treating an adaptively generated hypothesis as if it had been tested by the data that generated it.

6.3 Implications and unresolved mechanism

Mechanistic interpretation of the results. One plausible explanation is that the two sources define “hard” in different score spaces. Exact label search selects the highest-scoring incorrect label according to FF goodness under candidate-label injection, whereas the one-pass source selects the highest-logit incorrect label using a separately trained linear head operating on neutral-label features. Consequently, the two procedures can present different incorrect labels to the local FF objectives and thereby emphasize different class confusions during training. The present study did not directly measure source disagreement, the evolution of negative-label choices, layer-level learning dynamics, or any causal mediator. Therefore, this remains a plausible interpretation rather than an established mechanism.

Future question. Further prespecified studies could determine whether the paired effect changes with datasets, architectures, hyperparameters, or calibration schedules and could directly measure candidate-ranking disagreement or training dynamics. Such work would constitute new evidence rather than extending the present confidence interval. Computational cost remains an important practical trade-off because the one-pass source is intended to avoid repeated candidate-label evaluation during hard-negative selection. However, wall-clock training time was not a prespecified or accepted secondary endpoint and can depend strongly on implementation and hardware. We therefore do not report a retrospective quantitative speedup or infer a speed ordering from the present runs. A future prespecified study should evaluate classification error and computational cost jointly.

7. Limitations

This study had ten principal limitations. First, it only used MNIST. Second, it tested one FF model family and architecture under a frozen hyperparameter setting. Third, inference used 10 prespecified paired seeds, which limits the characterization of across-seed variability. Fourth, the primary endpoint was measured using a 5,000-example locked holdout derived from the official MNIST training set. Fifth, the official MNIST test set was deliberately excluded from the primary confirmation because it had previously been exposed; no official test secondary result was included. Sixth, Condition B used a fixed 20-epoch exact-label-search calibration period; therefore, other switch schedules were not tested confirmatorily. Seventh, this study concerns hard-negative sources and does not establish that one inference method is superior across settings. Eighth, secondary locked-holdout one-pass error and training-time comparisons were not included in the accepted primary analyses. Ninth, historical exploratory runs remain separate from confirmatory evidence and cannot increase their evidential scope. Finally, the effect size is specific to this implementation and configuration and should not be generalized beyond the tested setting without further evidence.

8. Reproducibility and Evidence Provenance

The recorded environment used Python 3.12.13, uv 0.11.15, Torch 2.9.1+cu128, torchvision 0.24.1+cu128, CUDA 12.8, and an NVIDIA A2 GPU. These identities bind the manuscript results to the frozen protocol, partition, implementation, environment, and analysis artifacts without presenting the private development repository as a public resource.

9. Conclusion

In a prospective paired-seed confirmatory study of supervised label-in-input FF learning on MNIST, exact label-search hard-negative generation throughout training yielded a lower mean locked-holdout label-search classification error than switching to a one-pass softmax hard-negative source after a fixed 20-epoch calibration period. The mean errors were 2.516% and 2.878%, respectively, and the mean paired B-minus-A difference was 0.362 percentage points, with a two-sided 95% confidence interval from 0.159 to 0.565 percentage points. Therefore, the prespecified rule classified H1 as supported. This conclusion is restricted to the frozen dataset partition, architecture, hyperparameters, schedules, seeds and label-search endpoint. However, the mechanism, computational tradeoffs, secondary endpoints, and generalization to other settings remain unresolved.

Conflict of Interest

The authors declare no conflict of interest.

Data and Code Availability

An audited public release of the reproducibility materials is planned at https://github.com/nshrhm/forward-forward-hard-negative-mnist. At the time of this manuscript draft, the repository had not yet been created; public release requires a separate audited release approval.

References

Xing Chen, Dongshu Liu, Jérémie Laydevant, and Julie Grollier (2025) “Self-Contrastive Forward-Forward algorithm,” Nature Communications, Vol. 16, Springer Nature, Article 5978. DOI: https://doi.org/10.1038/s41467-025-61037-0.

Ghader, M., Kheradpisheh, S. R. Farahani, B., Farahani, and Fazlali, M. (2026), “Backpropagation-free spiking neural networks with the forward-forward algorithm”, Scientific Reports, Vol. 16, Springer Nature, Article 14294. DOI: https://doi.org/10.1038/s41598-026-41671-4.

Geoffrey E. Hinton (2022), “The Forward-Forward Algorithm: Some Preliminary Investigations,” arXiv:2212.13345. DOI: https://doi.org/10.48550/arXiv.2212.13345.

Yann LeCun et al. (1998), “Gradient-Based Learning Applied to Document Recognition,” Proceedings of the IEEE, Vol. 86, No. 11, pp. 2278–2324. DOI: https://doi.org/10.1109/5.726791.

Guy Lorberbom, Itai Gat, Yossi A di, Alexander Schwing, and Tamir Hazan (2024) “Layer Collaboration in the Forward-Forward Algorithm,” Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 38, No. 13, AAAI Press, pp. 14141–14148. DOI: https://doi.org/10.1609/aaai.v38i13.29324.

Andreas Papachristodoulou, Christos Kyrkou, Stelios Timotheou, and Theocharis Theocharides (2024) “Convolutional Channel-Wise Competitive Learning for the Forward-Forward Algorithm,” Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 38, No. 13, AAAI Press, pp. 14536–14544. DOI: https://doi.org/10.1609/aaai.v38i13.29369.

Joshua David Robinson, Ching-Yao Chuang, Suvrit Sra, and Stefanie Jegelka (2021), “Contrastive Learning with Hard Negative Samples,” International Conference on Learning Representations (ICLR), OpenReview.net / ICLR.

Riccardo Scodellaro, Ajinkya Kulkarni, Frauke Alves, and Matthias Schröter (2025) “Training convolutional neural networks with the Forward-Forward Algorithm,” Scientific Reports, Vol. 15, Article 38461. DOI: https://doi.org/10.1038/s41598-025-26235-2.

Naruki Shirahama, Naofumi Nakaya, and Satoshi Watanabe (2026) “Replication of the Forward-Forward Algorithm on MNIST and a Log of Hyperparameter Search”, Journal of Intelligence Science in Local Research, Vol. 2, No. 2, pp. 19–29. DOI: https://doi.org/10.60457/jislr.2.2_19.

Gongpei Zhao, Tao Wang, Yi Jin, Congyan Lang, Yidong Li, and Haibin Ling (2025) “The Cascaded Forward algorithm for neural network training,” Pattern Recognition, Vol. 161, Article 111292. DOI: https://doi.org/10.1016/j.patcog.2024.111292.

 
© Shimonoseki City University

この記事はクリエイティブ・コモンズ [表示 - 非営利 4.0 国際]ライセンスの下に提供されています。
https://creativecommons.org/licenses/by-nc/4.0/deed.ja
feedback
Top