Manuscript Offprint
arXiv:2610.06437HeuFouFT: Task-Guided Metaheuristic Coordinate Search for Fourier Fine-Tuning
ABSTRACT
We introduce Heuristic-Guided Fourier Fine-Tuning (HeuFouFT), a task-guided framework for selecting trainable frequency coordinates in Fourier fine-tuning. Existing uniform and Gaussian band-pass schemes allocate a limited spectral budget through fixed, task-agnostic rules. HeuFouFT instead searches for coordinates using downstream performance. A coarse intensity map from lightweight block-level probes initializes three metaheuristic optimizers: Genetic Algorithm with Simulated Annealing (GA-SA), Particle Swarm Optimization (PSO), and Cuckoo Search (CS). During search, a Random Forest filters each population so that only the top 30% of candidates proceed to proxy fine-tuning. On E2E with GPT-2-Medium, all three variants outperform random-uniform FourierFT, Gaussian band-pass FourierFT, and LoRA across five metrics. PSO further outperforms LoCA, the best-performing baseline, on four metrics while using 37.6% fewer trainable spectral coefficients. Once coordinates are selected, HeuFouFT requires only 15–18% FLOPs of Full FT. These results show that task-guided search allocates limited spectral capacity more effectively than fixed sampling. Our code is publicly available.
Index Terms— Parameter-Efficient Fine-Tuning, Meta-Heuristics, Frequency Sampling, Large Language Models
1. INTRODUCTION
Parameter-efficient fine-tuning (PEFT) adapts large language models by learning a small set of parameters while keeping pretrained weights frozen. LoRA represents weight updates through low-rank factors [1]. Spectral methods offer another parameterization by learning coefficients in a transform domain, where a compact representation can reduce the number of trainable parameters [2, 3].
Several approaches exploit spectral structure in adaptation. F-Adapter allocates adapter capacity according to spectral complexity [4], while FouRA applies Fourier and cosine transforms within low-rank adaptation for vision models [5].

Fig. 1: Log-magnitude spectrum of the layer-1 Q projection from GPT-2-Medium LoRA fine-tuned on E2E (rank 8). Red markers indicate the 328 highest-energy frequency bins; blue markers show the 328 uniform random samples; green markers show 328 Gaussian band-pass samples.
LoCA jointly learns coefficients and their locations in a cosine representation [6]. HeuFouFT differs by selecting a discrete, layer-shared Fourier coordinate set before final fine-tuning through validation-guided derivative-free search.
FourierFT constructs weight updates through an inverse discrete Fourier transform of selected coefficients [3]. Its default uniform sampling and optional Gaussian band-pass sampling choose coordinates through fixed, task-agnostic rules, so the selected frequency coordinates cannot adapt to the downstream task.
The choice of coordinates matters when only a small number of Fourier components can be trained. As Figure 1 shows, a learned LoRA update can exhibit localized spectral energy that is poorly covered by uniform or radially constrained sampling. Although this spectrum is not an oracle for FourierFT, it motivates selecting coordinates using downstream task feedback.
To realize this selection, we draw on derivative-free optimization, which recent efforts [7, 8] have applied to low-rank adaptation. Motivated by metaheuristic optimization [9, 10, 11], we introduce HeuFouFT. Our contributions are threefold. First, we make Fourier coordinate selection responsive to downstream performance rather than a fixed sampling rule. Second, we develop a surrogate-assisted framework that combines a block-level task prior with three metaheuristic optimizers, GA-SA, PSO, and CS, to refine
Corresponding author: zcqin@buaa.edu.cn.
Code is available at https://github.com/pierrewang2024-collab/HeuFouFT.
complete coordinate sets. Third, on GPT-2-Medium and E2E, all three variants outperform fixed sampling and LoRA across five metrics while using 37.6% fewer spectral coefficients than the FourierFT and LoCA configurations; PSO further outperforms LoCA on four metrics.
where denotes the inverse two-dimensional DFT, extracts the real part, and controls the update scale. As in FourierFT, the coefficients are real scalars and the real projection in Eq. (1) produces a real-valued update without requiring paired coefficients. Each layer learns its own coefficients while sharing and ; the trainable parameter count is therefore exactly per adapted matrix.
For a fixed budget n, the coordinates in E determine the Fourier components that can contribute to . Learning c adjusts their amplitudes within the resulting update subspace. Frequency selection therefore controls the directions for adaptation. Figure 1 reveals that LoRA-derived has its top energy bins concentrated in localized peaks, sharing little overlap with either uniform random sampling or Gaussian band-pass sampling. Fixed schemes cannot align their parameter budget with these irregular regions. Random-uniform FourierFT assigns every coordinate equal selection probability, while Gaussian band-pass sampling constrains selection to an annulus. Our search instead uses lightweight fine-tuning on coarse frequency blocks to initialize the optimizers with task-informed scores.
Spectral evidence alone cannot rank frequency regions by adaptation value. Figure 1 depicts one particular low-rank solution, and Table 1 shows that the preferred Gaussian band-pass setting varies across evaluation metrics. Task feedback is therefore needed to decide where the parameter budget should be placed, and the block-level probes introduced next provide this feedback.
3. FREQUENCY-DOMAIN SAMPLING APPROACHES
We first consider two baseline strategies for selecting the frequency coordinates E. Uniform sampling selects n points with equal probability, while Gaussian band-pass sampling favors an annulus controlled by frequency bias and bandwidth W. Setting gives a low-pass region.
3.1. Heuristic Information Foundation
To guide sampling with task feedback, we partition the frequency domain into a grid and probe each block through lightweight fine-tuning on 10% of the training data for one epoch, scoring each probe on the validation split. Each probe returns the five NLG metrics, which we normalize and aggregate into a heuristic intensity
where the normalization removes scale differences among metrics and the coefficients encode relative preferences over them [12]. For every spectral region, the intensity map scores the downstream performance achievable by placing trainable coefficients there. Notably, the intensity distribution tracks the spectral energy concentration of the low-rank update in Figure 1, with a Pearson coefficient of across the frequency blocks, which supports the reliability of the heuristic map.
Instead of the spectral magnitude of the frozen model, this map measures adaptation value: a spectrally modest region may host coordinates that strongly benefit the task, and vice versa. Because each block score averages over an entire region, however, it cannot indicate which coordinates within a block matter. To resolve this, the metaheuristic searches start from the map, evaluate complete coordinate sets against task performance, and refine the selection below block granularity.
During search, a Random Forest acts as a filter for each newly generated population. It predicts candidate fitness, and only the top 30% proceed to proxy fine-tuning and validation; the remaining 70% are discarded without training. The surrogate achieves on held-out candidates. Its features, labels, and hyperparameters are documented in the released code. All task feedback, including block probes, surrogate labels, and search fitness, is computed on the validation split; reported results use the held-out test set.
3.2. Metaheuristic Sampling Algorithms
Starting from candidates initialized with the block-level prior, we compare three searches for the layer-shared coordinate set E under a fixed budget on a grid ( ). Each retained candidate is evaluated by fine-tuning its coefficients on 10% of the training data for one epoch. Its validation HI score from Eq. (2) serves as the search fitness.
Genetic-Simulated Annealing (GA-SA) combines evolutionary search with probabilistic acceptance to reduce premature convergence [9, 13, 14]. Each chromosome encodes a complete set of frequency coordinates. Two-point crossover and bit-flip mutation ( ) generate candidates. SA accepts candidates of equal or higher fitness, and accepts a decrease of magnitude with probability , allowing
| BLEU | NIST | METEOR | ROUGE-L | CIDEr | |
|---|---|---|---|---|---|
| 0 | 68.7 | 8.35 | 41.3 | 67.5 | 1.65 |
| 100 | 67.3 | 8.23 | 41.2 | 67.8 | 1.66 |
| 200 | 67.6 | 8.41 | 40.9 | 67.4 | 1.64 |
| 300 | 69.2 | 8.36 | 41.4 | 67.7 | 1.63 |
| 400 | 68.7 | 8.26 | 40.8 | 67.9 | 1.64 |
| 500 | 62.5 | 8.30 | 40.3 | 66.7 | 1.61 |
Table 1: Gaussian band-pass sampling with different frequency biases. Best values are bold.
exploration beyond local optima. The temperature starts at and decays by a factor of 0.95 per iteration.
Particle Swarm Optimization (PSO) treats each sampling set as a particle whose coordinate velocities follow its personal best and the swarm's best solution [10, 15, 16]. The inertia weight decreases linearly from 0.9 to 0.4 over the first 200 iterations, remaining at 0.4 thereafter. For either integer coordinate , the updated velocity determines a discrete move:
where and . Modulo arithmetic enforces the grid boundaries, and duplicate coordinates are replaced to preserve the budget.
Cuckoo Search (CS) represents each sampling set as a binary mask and perturbs it through Lévy flights [11, 17, 18]. The heavy-tailed steps permit long-range exploration of sparse high-frequency regions. We use and a step size with a cosine decay from 0.5 to 0.1 over the first 100 iterations, remaining at 0.1 thereafter. Candidate masks remain subject to the sampling budget and coordinate uniqueness. Nest selection and duplicate-point removal refine the resulting sampling sets.
4. EXPERIMENTAL STUDIES
We evaluate GPT-2-Medium [19] on E2E [20], using 42,000 training examples and 4,600 examples each for validation and testing. Baselines include Full FT, LoRA [1], LoCA [6], and FourierFT with uniform or Gaussian band-pass sampling [3]. We report BLEU, NIST, METEOR, ROUGE-L, and CIDEr [21, 22, 23, 24, 25].
All PEFT methods adapt the and projections, following common practice for LoRA [1], while Full FT updates the complete model. All methods use AdamW with batch size 4 for three epochs. Learning rates are for FourierFT and LoCA, for LoRA, and for Full FT. LoRA uses rank 8; LoCA uses 1,000 spectral coefficients per adapted matrix; and FourierFT uses . FourierFT and LoCA therefore train 48,000 spectral coefficients across 24 layers and two matrices per layer. HeuFouFT uses 624 selected coordinates and 624 independently trainable real coefficients per matrix, giving parameters (0.030M), fewer than those configurations. The selected is fixed across three seeds, so the standard deviations reflect fine-tuning stochasticity rather than search variance.
| Method | BLEU | NIST | METEOR | ROUGE-L | CIDEr | Params. (M) |
|---|---|---|---|---|---|---|
| Full FT | 68.9 | 8.36 | 40.1 | 67.2 | 1.59 | 354.92 |
| LoRA | 68.4±.2 | 8.34±.05 | 41.0±.1 | 67.1±.3 | 1.57±.02 | 0.786 |
| LoCA | 70.3±.1 | 8.51±.03 | 41.6±.08 | 68.5±.2 | 1.64±.01 | 0.048 |
| Random | 66.7 | 8.24 | 40.2 | 66.5 | 1.54 | 0.048 |
| Uniform | ±.2 | ±.04 | ±.09 | ±.2 | ±.03 | |
| Gaussian | 69.2 | 8.36 | 41.4 | 67.7 | 1.63 | 0.048 |
| Band-Pass | ±.1 | ±.05 | ±.07 | ±.2 | ±.02 | |
| Vanilla GA | 69.6±.1 | 8.72±.03 | 41.4±.08 | 67.3±.2 | 1.63±.01 | 0.03 |
| GA-SA | 70.6±.1 | 8.73±.03 | 41.5±.07 | 68.6±.2 | 1.68±.01 | 0.03 |
| PSO | 70.9±.2 | 8.78±.02 | 41.8±.05 | 68.5±.3 | 1.71±.02 | 0.03 |
| CS | 70.4±.1 | 8.75±.01 | 41.6±.04 | 68.9±.2 | 1.69±.01 | 0.03 |
Table 2: GPT-2-Medium performance on E2E. Entries with error terms show the mean and standard deviation over seeds 41, 42, and 43. Best baseline and HeuFouFT results are bolded separately.
4.1. Frequency Bias and Block Sampling
We test six Gaussian frequency biases, from to 500 in steps of 100, with and all other settings fixed. As Table 1 shows, the best setting differs across metrics, so no single places the annulus optimally for all of them. Changing shifts the sampling distribution globally but does not optimize individual in-band coordinates using task feedback. This limitation motivates block-level feedback and coordinate-wise search.
4.2. Overall Performance
Table 2 compares the selected coordinate sets with the baselines. Vanilla GA removes simulated annealing from GA-SA, providing an ablation of the acceptance mechanism under the same parameter budget. All three HeuFouFT variants use the same intensity map, so their differences reflect the search strategies under a common prior.
PSO achieves the highest BLEU, NIST, METEOR, and CIDEr, while CS yields the highest ROUGE-L. All three HeuFouFT variants outperform the fixed sampling baselines and LoRA. They do so with fewer coefficients

Fig. 2: Distributions of the selected frequency coordinates, shared across layers, for GA-SA (left), PSO (middle), and CS (right). Dashed circles mark frequency bands.
than the FourierFT configurations, showing that task feedback can allocate a smaller spectral budget more effectively than a random-uniform draw or a radial band. Adding simulated annealing to Vanilla GA improves all five metrics. The consistent gain supports its role in escaping local optima that greedy evolution can settle into.
The three optimizers use the common intensity prior in different ways. PSO repeatedly moves candidates toward personal and swarm bests, so its coordinates cluster around a compact middle-frequency region favored by the prior. CS makes occasional long jumps through Lévy flights and replaces weaker nests, producing broader exploration and more high-frequency coordinates. GA-SA combines crossover and mutation with annealed acceptance of temporary fitness decreases; it therefore preserves a more balanced middle-to-high-frequency distribution and is less likely to collapse around one region. Their similar downstream performance indicates that the task-guided framework supplies the main gain, while the optimizer controls how the region rich in frequency-domain information is explored.
4.3. Sampling Behavior and Efficiency
We use four quantities to read Figures 2 and 3. Energy density is the normalized squared spectral magnitude at each coordinate. Energy concentration is the fraction of total update energy captured by the selected coordinates. Coverage efficiency measures how well the selection covers regions that have both high heuristic intensity and high energy density. Sampling quality summarizes the balance between concentrating on strong components and covering useful regions; a high value requires both rather than either alone.
The figures confirm the distinct sampling behaviors of the three optimizers. PSO places 84.5% of its coordinates in the middle band and obtains the highest energy concentration and sampling quality, showing focused exploitation of strong components. CS places 79.6% in the high band and obtains the highest coverage efficiency, consistent with broader exploration of useful regions. GA-SA splits nearly all coordinates between the middle and high bands and scores lower on the aggregate quality measure, reflecting its more diffuse search. These profiles align with the metric results: PSO leads

Fig. 3: Frequency-domain metrics of GA-SA, PSO, and CS. Panels show frequency ratios, energy concentration, coverage efficiency, and sampling quality.
on four metrics, whereas CS leads on ROUGE-L. The distinction reflects how each optimizer allocates the spectral budget, which enables more flexible frequency-domain coordinate selection.
The Random Forest limits proxy fine-tuning to the top 30% of each candidate population [26]. GA-SA, PSO, and CS finish after 175, 240, and 151 iterations, taking 2.92, 3.00, and 1.26 h, respectively. CS has the shortest search time, while PSO gives the best results on four metrics. Map construction takes 1.25 h; fitting the surrogate, running the search, and final fine-tuning bring the full pipeline to about 12 h on one NVIDIA A100 80GB GPU in FP16. Coordinate selection is paid once for a task and can be amortized when the selected set is reused.
After E is fixed, HeuFouFT uses 15–18% of Full FT FLOPs and about 9% of its peak memory. The corresponding figures are 40% and 28% for LoRA, and 25% and 12% for FourierFT and LoCA. Thus, post-selection HeuFouFT uses 28–40% fewer FLOPs and 25% less memory than FourierFT and LoCA; the separate search cost is reported above.
5. CONCLUSION
We presented HeuFouFT, a task-guided framework that selects Fourier coordinates using block-level probes, Random Forest filtering, and metaheuristic search. On GPT-2-Medium and E2E, all three variants outperform fixed sampling and LoRA across five metrics while using 37.6% fewer coefficients than the FourierFT and LoCA configurations; PSO further outperforms LoCA on four metrics. Once coordinates are selected, HeuFouFT requires only 15–18% FLOPs of Full FT. Moreover, the three searches reach similar performance from distinct frequency distributions, so the benefit stems from task-guided selection itself rather than the optimizer. These results demonstrate that task-guided coordinate search can allocate limited spectral adaptation capacity effectively.
6. REFERENCES
[1] E. J. Hu et al., “LoRA: Low-rank adaptation of large language models,” in Proc. Int. Conf. Learn. Represent. (ICLR), Apr. 2022.
[2] K. Xu, M. Qin, F. Sun, Y. Wang, Y.-K. Chen, and F. Ren, "Learning in the frequency domain," in Proc. IEEE/CVF Conf. Comput. Vis. Pattern Recognit., June 2020, pp. 1737–1746.
[3] Z. Gao et al., “Parameter-efficient fine-tuning with discrete Fourier transform,” in Proc. Int. Conf. Mach. Learn. (ICML), July 2024, vol. 235 of Proc. Mach. Learn. Res., pp. 14884–14901.
[4] H. Zhang, C. Kang, Y. Wang, and D. Zou, “F-Adapter: Frequency-adaptive parameter-efficient fine-tuning in scientific machine learning,” in Adv. Neural Inf. Process. Syst., 2025, vol. 38, pp. 111120–111162.
[5] S. Borse et al., “FouRA: Fourier low-rank adaptation,” in Adv. Neural Inf. Process. Syst., 2024, vol. 37, pp. 71504–71539.
[6] Z. Du et al., “LoCA: Location-aware cosine adaptation for parameter-efficient fine-tuning,” in Proc. Int. Conf. Learn. Represent. (ICLR), 2025, pp. 86234–86274.
[7] F. Jin, Y. Liu, and Y. Tan, “Derivative-free optimization for low-rank adaptation in large language models,” IEEE/ACM Trans. Audio, Speech, Lang. Process., vol. 32, pp. 4607–4616, Oct. 2024.
[8] X. Qiu et al., “Evolution strategies at scale: LLM fine-tuning beyond reinforcement learning,” 2025, arXiv:2509.24372v1.
[9] J. H. Holland, Adaptation in Natural and Artificial Systems: An Introductory Analysis with Applications to Biology, Control, and Artificial Intelligence, University of Michigan Press, Ann Arbor, MI, USA, 1975.
[10] J. Kennedy and R. Eberhart, “Particle swarm optimization,” in Proc. IEEE Int. Conf. Neural Netw. (ICNN), 1995, vol. 4, pp. 1942–1948.
[11] X.-S. Yang and S. Deb, “Cuckoo search via Lévy flights,” in Proc. World Congr. Nature Biol. Inspired Comput. (NaBIC), 2009, pp. 210–214.
[12] R. T. Marler and J. S. Arora, “The weighted sum method for multi-objective optimization: new insights,” Struct. Multidiscip. Optim., vol. 41, no. 6, pp. 853–862, June 2010.
[13] S. Bisht, “Hybrid genetic-simulated annealing algorithm for optimal weapon allocation in multilayer defence scenario,” Def. Sci. J., vol. 54, no. 3, pp. 395–405, July 2004.
[14] Z. Liang, M. Liu, P. Zhong, C. Zhang, and X. Wang, “Hybrid algorithm based on genetic simulated annealing algorithm for complex multiproduct scheduling problem with zero-wait constraint,” Math. Probl. Eng., vol. 2021, no. 1, June 2021, Art. no. 9951995.
[15] A. Oucif, A. Siam, and M. E. H. Souidi, “A discrete particle swarm optimization for same-day delivery with vehicles and drones,” J. Intell. & Fuzzy Syst., vol. 50, no. 1, pp. 138–160, Jan. 2026.
[16] J. Liu, Y. Han, Y. Wang, B. Zhang, and K. Gao, “Q-learning-enhanced reconstructed discrete particle swarm optimization for distributed hybrid flowshop scheduling with consistent sublots allocation,” Eng. Optim., vol. 58, no. 4, pp. 1191–1222, Apr. 2026.
[17] A. Ouaarab, B. Ahiod, and X.-S. Yang, “Discrete cuckoo search algorithm for the travelling salesman problem,” Neural Comput. Appl., vol. 24, no. 7–8, pp. 1659–1669, June 2014.
[18] K. Bibiks, F. Hu, J.-P. Li, and A. Smith, “Discrete cuckoo search for resource constrained project scheduling problem,” in Proc. IEEE 18th Int. Conf. Comput. Sci. Eng., Oct. 2015, pp. 240–245.
[19] A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, and I. Sutskever, “Language models are unsupervised multitask learners,” Tech. Rep., OpenAI, Feb. 2019, [Online]. Available: https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf.
[20] J. Novikova, O. Dušek, and V. Rieser, “The E2E dataset: New challenges for end-to-end generation,” in Proc. 18th Annu. SIGdial Meeting Discourse Dialogue, Aug. 2017, pp. 201–206.
[21] K. Papineni, S. Roukos, T. Ward, and W.-J. Zhu, “BLEU: a method for automatic evaluation of machine translation,” in Proc. 40th Annu. Meeting Assoc. Comput. Linguistics, July 2002, pp. 311–318.
[22] G. Doddington, “Automatic evaluation of machine translation quality using n-gram co-occurrence statistics,” in Proc. 2nd Int. Conf. Human Lang. Technol. Res., Mar. 2002, pp. 138–145.
[23] S. Banerjee and A. Lavie, “METEOR: An automatic metric for MT evaluation with improved correlation with human judgments,” in Proc. ACL Workshop Intrinsic Extrinsic Eval. Measures Mach. Transl. Summarization, June 2005, pp. 65–72.
[24] C.-Y. Lin, “ROUGE: A package for automatic evaluation of summaries,” in Text Summarization Branches Out, July 2004, pp. 74–81.
[25] R. Vedantam, C. L. Zitnick, and D. Parikh, “CIDEr: Consensus-based image description evaluation,” in Proc. IEEE Conf. Comput. Vis. Pattern Recognit., June 2015, pp. 4566–4575.
[26] Y. Sun, H. Wang, B. Xue, Y. Jin, G. G. Yen, and M. Zhang, “Surrogate-assisted evolutionary deep learning using an end-to-end random forest-based performance predictor,” IEEE Trans. Evol. Comput., vol. 24, no. 2, pp. 350–364, Apr. 2020.
A. FREQUENCY DOMAIN INFORMATION METRICS
A.1. Spectral Entropy
Spectral entropy is a core indicator for evaluating the uniformity of information distribution in the frequency domain, which is defined as the Shannon entropy of the spectral density function:
where is a normalized spectral density function, satisfying .
For discrete frequency spectra, the spectral entropy can be approximately calculated as:
And the normalized spectral energy distribution is as follows:
The value range of spectral entropy is . A larger value indicates a more uniform energy distribution in the frequency domain and a lower information density.
A.2. Spectral Information Density
Spectral Information Density (SID) is another important indicator, which is used to measure the information content per unit frequency range. It can be defined by the ratio of spectral entropy to the maximum possible entropy:
where is the maximum possible entropy value, corresponding to the case of completely uniform distribution.
The value range of spectral information density is . A larger value indicates that the information distribution in the frequency domain is closer to a uniform state, and the information density is lower.
A.3. Low-Frequency Energy Ratio
Low-Frequency Energy Ratio (LFER) is another key indicator for evaluating the energy distribution in the frequency domain, which quantifies the proportion of energy in the low-frequency region to the total energy:
where denotes the low-frequency region, which is usually defined as a circular or square region with the spectrum center as the center and radius R. The value range of LFER is [0, 1], and a larger value indicates a higher proportion of low-frequency components in the total energy.
A.4. Coverage Efficiency
Coverage Efficiency measures the weighted coverage of sampling points over regions that are both heuristically critical and energy-dense. It normalizes the weighted count of sampled points in high-value regions by the weighted area of these regions, where “weight” is defined as the product of Heuristic Intensity (HI) and Energy Density (ED) at each frequency-domain position.
where S: Set of sampled frequency-domain points. HI(u, v): Heuristic Intensity at position , defined as a weighted score of NLG metrics (e.g., HI = 0.3BLEU + 0.2METEOR + 0.2ROUGE-L + 0.15NIST + 0.15CIDEr) from lightweight fine-tuning of sub-regions.
ED(u, v): Energy Density at position , defined as (normalized frequency-domain coefficient amplitude). : Set of high-value frequency-domain positions where ( is a threshold, e.g., the 75th percentile of across the entire matrix). : Total area of the frequency-domain matrix. : Weighted area of , capturing both heuristic and energy importance.
A.5. Energy Concentration
Energy Concentration (EC) is a core indicator for evaluating the effectiveness of frequency-domain sampling strategies, which quantifies the ability to retain key energy components of the weight update signal ( ) during the sampling process. In frequency-domain fine-tuning, the signal energy is typically concentrated in a small number of low-frequency or characteristic frequency components. By calculating the proportion of energy covered by the frequency points selected through sampling, this indicator directly reflects the accuracy of the sampling strategy: a higher EC value indicates that the sampling points are more capable of focusing on core energy components, resulting in less redundant computation and higher fine-tuning efficiency.
Based on the frequency-domain representation of the Discrete Fourier Transform (DFT) and Parseval's theorem, the mathematical definition of Energy Concentration is given as:
The detailed explanations of each parameter are as follows:
-
N: The total number of points in the discrete Fourier transform, corresponding to the length of the frequency-domain sequence of the weight update signal after DFT conversion;
-
: The k-th component of the frequency-domain sequence , where the magnitude reflects the energy intensity of the corresponding frequency component;
-
M: The number of key frequency points selected by the frequency-domain sampling strategy (i.e., the sampling scale of HeuFouFT in this paper, e.g., );
-
: The top M frequency-domain components with the highest energy, sorted in descending order of magnitude ;
-
The numerator represents the total energy covered by the sampling points, and the denominator represents the full energy of the frequency-domain signal. The value range of EC is .
B. NLG EVALUATION METRICS
B.1. BLEU
BLEU (Bilingual Evaluation Understudy) quantifies the quality of machine-generated text by comparing it to human-annotated reference texts, with scores ranging from 0 to 1 (typically 0.2–0.5 for acceptable performance). Its core principle is to measure the proportion of matching n-grams between candidate and reference texts, with higher overlap indicating better quality. While computationally efficient and widely adopted, BLEU is semantics-agnostic and tends to overvalue short texts. The formula is:
where (length penalty, ), is the clipped n-gram precision, and are weights (default: uniform for 1–4-grams).
B.2. NIST
NIST (National Institute of Standards and Technology) improves BLEU by incorporating information-weighted n-grams (via mutual information entropy). Unlike BLEU's geometric mean, NIST uses a weighted arithmetic mean, emphasizing rare but informative n-grams. Scores range from 0 to 10 (2–8 considered ideal). Advantages include word order and semantic sensitivity, though it underweights low-frequency terms. The formula is:
where T is the set of n-grams in references, is the clipped count in the candidate, and balances n-gram orders.
B.3. METEOR
METEOR (Metric for Evaluation of Translation with Explicit Ordering) aligns candidate and reference texts via stem/synonym matching and penalizes word-order mismatches. It computes a harmonic mean of precision (P) and recall (R), with parameters , , (default: 0.9, 3, 0.5). Scores range from 0 to 1 (0.3–0.6 for good quality). Strong semantic sensitivity and word-order awareness come at the cost of higher computational complexity. The formula is:
B.4. ROUGE-L
ROUGE-L (Recall-Oriented Understudy for Gisting Evaluation–Longest Common Subsequence) measures similarity via the longest common subsequence (LCS) between candidate and reference summaries, capturing paraphrasing and semantic coherence. Scores range from 0 to 1 (0.2–0.4 typical), with balancing recall (R) and precision (P). Advantages include long-range semantic capture, though word-order details are ignored. The formula is:
where X is the reference, Y the candidate, and (default: for recall emphasis).
B.5. CIDEr
CIDEr (Consensus-based Image Description Evaluation) measures coherence via TF-IDF-weighted n-gram similarity between candidate and reference descriptions, with geometric averaging across references. Scores range from 0 to 10 ( 1.0 favorable), rewarding semantic diversity while ignoring syntax errors. The formula is:
where M is the number of references, is the TF-IDF cosine similarity with reference .
C. RANDOM FOREST SURROGATE MODEL FOR META-HEURISTIC FREQUENCY-DOMAIN SAMPLING
C.1. Motivation and Design Rationale
The Random Forest (RF) surrogate model in HeuFouFT is designed to filter low-potential frequency candidates prior to meta-heuristic optimization (GA-SA, PSO, CS), reducing redundant computations while preserving high-performance sampling points. Its core design aligns with HeuFouFT's heuristic sampling philosophy: prioritize frequency components that contribute most to fine-tuning performance by leveraging multi-dimensional spectral features. The model is trained to map spectral characteristics of frequency candidates to their actual fine-tuning performance (e.g., BLEU score), enabling rapid screening of high-value candidates.
C.2. Feature Selection for Spectral Characterization
Different from the frequency evaluation measures of Appendix A, we select 7 spectral features to capture the energy distribution, information density, and frequency structure of candidate frequency points—covering mandatory indicators easy to calculate and domain-specific supplementary features in table 5. All features are computed based on the DFT-transformed weight update signal (denoted as for the k-th frequency component, ).
C.3. Hyperparameter Configuration
The RF hyperparameters are tuned to balance prediction accuracy and computational efficiency, consistent with HeuFouFT's experimental setup (GPT-2 Medium, E2E NLG dataset) and meta-heuristic optimization constraints. Key hyperparameters and their optimal values are summarized in Table 3:
C.4. Training Algorithm Flow
The RF surrogate model training follows a data-driven pipeline integrated with HeuFouFT's heuristic sampling framework, as detailed in Algorithm 1:
C.5. Computational Cost Evaluation
We evaluate the computational cost of the RF surrogate model on a single NVIDIA A100 80GB GPU (FP16 precision), consistent with HeuFouFT's experimental hardware. The cost comparison (vs. direct meta-heuristic optimization) is shown in Table 4, placed at the top of the page for easy reference:
Key observations: 1. The RF surrogate model reduces overall computational cost by 68% by filtering 70% of low-potential candidates. 2. Data collection dominates the RF-related cost (81%), which is a one-time overhead for multiple meta-heuristic iterations. 3. The inference stage is computationally lightweight (less than 0.5 GPU-hours), ensuring minimal latency in the sampling pipeline. 4. The cost aligns with typical LLM fine-tuning expenses on cloud GPUs, making the approach scalable for larger models (e.g., Llama 3-7B).
D. COMPUTATIONAL COST ANALYSIS OF META-HEURISTIC SAMPLING ALGORITHMS
This section details the exact compute budget, wall-clock time, and measurement methodology for key components of HeuFouFT. All experiments are conducted on a single NVIDIA A100 80GB GPU with FP16 precision, using PyTorch 2.1 and CUDA 12.2 for acceleration.
For constructing the heuristic intensity map, the frequency-domain matrix is partitioned into 100 non-overlapping blocks, with each block undergoing lightweight fine-tuning (10% of E2E training data: 4,200 samples; batch size=4; max_seq_len=128; 1 epoch) to compute heuristic intensity via weighted NLG metrics (BLEU, METEOR, ROUGE-L, NIST, CIDEr). Each block takes 45 seconds for forward/backward passes and metric computation, leading to a total wall-clock time of s = 75 minutes (1.25 hours) and total FLOPs of (with FLOPs per block). For labeling 5000 schemes for the surrogate model, each randomly generated sampling scheme is evaluated via the same lightweight fine-tuning setup (no parameter updates), taking 30 seconds per scheme to obtain heuristic intensity labels; this results in a total wall-clock time of s = 25,000 s (6.94 hours) and total FLOPs of (with FLOPs per scheme).
Regarding the meta-heuristic searches, the GA-SA hybrid algorithm uses a population size of 100, 175 total iterations, a mutation probability of 0.05, initial temperature of 1000, and decay rate of 0.95, with per-iteration operations including two-point crossover, bit-flip mutation, and Metropolis acceptance criterion; each iteration takes 60 seconds, leading to a total wall-clock time of s = 175 minutes (2.92 hours) and total FLOPs of (with FLOPs per iteration).
The Particle Swarm Optimization (PSO) algorithm employs 50 particles, 240 total iterations, a linearly decreasing inertia weight (from 0.9 to 0.4), and acceleration constants , with per-iteration operations including velocity update, sigmoid-based position adjustment, and boundary constraint enforcement via modulo arithmetic; each iteration takes 45 seconds, resulting in a total wall-clock time of s = 180 minutes (3 hours) and total FLOPs of (with FLOPs per iteration).
The Cuckoo Search (CS) with Lévy Flights uses 20 nests, 151 total iterations, a Lévy flight parameter , a cosine-decayed step size (from 0.5 to 0.1), and a nest elimination probability of 0.25, with per-iteration operations including Lévy flight perturbation, nest selection, and duplicate point removal; each iteration takes 30 seconds, leading to a total wall-clock time of s = 75.5 minutes (1.26 hours) and total FLOPs of (with FLOPs per iteration).
The FLOP and memory reduction metrics reported in the main text are end-to-end, encompassing all steps of HeuFouFT: heuristic intensity map construction, surrogate model labeling and training, meta-heuristic sampling search, and final fine-tuning of the LLM, ensuring a comprehensive comparison with baselines (e.g., LoRA, vanilla FourierFT) that only include final training. For FLOPs calculation, we track floating-point operations via torch.cuda.flops_counter() across all computational graphs (forward/backward passes for fine-tuning, sampling scheme generation, surrogate model training), with FP16 precision consistently applied to align with GPU hardware capabilities and reduce redundant computations. Peak GPU memory usage is recorded via torch.cuda.max_memory_allocated(), including model weights (LLM + surrogate), intermediate activations, sampling scheme storage, and gradient buffers, with cache management (e.g., clearing unused tensors post-iteration) applied to mimic real-world deployment. Wall-clock time is measured via time.perf_counter(), with data loading time excluded (preprocessed E2E data is cached in GPU memory to eliminate I/O overhead), and each step is repeated 3 times to report the average time accounting for minor runtime fluctuations.
Algorithm 1 Random Forest Surrogate Model Training for HeuFouFT
Require: Weight update signal , DFT size , candidate sampling size , meta-heuristic sampling scale
Ensure: Trained RF surrogate model , high-potential frequency candidate set
1: Step 1: Training Data Collection
2: Randomly sample frequency candidate sets from the frequency domain , where each has size
3: for each do
4: Perform FourierFT fine-tuning with to get performance label (BLEU score)
5: Compute 7 spectral features (Section C C.2) for to form feature vector
6: end for
7: Construct training dataset
8: Step 2: Dataset Preprocessing
9: Split into training set (80%) and validation set (20%)
10: Normalize feature vectors in and using min-max scaling
11: Step 3: Hyperparameter Optimization
12: Use Bayesian Optimization to search hyperparameter space (Table 3) to maximize on
13: Step 4: Model Training and Validation
14: Train RF model with optimized hyperparameters on
15: Evaluate model performance on ; if , augment with 1000 additional samples and retrain
16: Step 5: High-Potential Candidate Selection
17: Apply to predict performance of all candidate sets generated by initial random sampling
18: Select top 30% candidates with highest predicted performance to form
19: Output for subsequent meta-heuristic optimization (GA-SA/PSO/CS)
Table 3: Hyperparameter Configuration of Random Forest Surrogate Model
| Hyperparameter | Value Range | Optimal Value | Design Rationale |
|---|---|---|---|
| Number of Estimators | 100–500 | 300 | Balances model variance (fewer trees: high variance) and computational cost (more trees: high cost). |
| Max Depth | 10–50 | 25 | Prevents overfitting (too deep: memorizes noise) while capturing complex feature-performance relationships. |
| Min Samples Split | 2–10 | 5 | Ensures splits are statistically meaningful (avoids trivial splits on small subsets). |
| Min Samples Leaf | 1–5 | 2 | Reduces overfitting by requiring minimum samples in leaf nodes (avoids isolated data points). |
| Max Features | () | Uses square-root of total features to balance diversity (randomness) and predictive power. | |
| Learning Rate (for boosting) | 0.01–0.1 | — | Not used (RF is an ensemble of unboosted trees). |
Hyperparameters are optimized via Bayesian Optimization (Section C C.4) to maximize on the validation set.
Table 4: Computational Cost Comparison
| Computational Stage | Wall-Clock Time | GPU-Hours | Cost (USD, 10 USD/hour) |
|---|---|---|---|
| RF Training Data Collection | 12.0 hours | 12.0 | 120.0 |
| RF Model Training (incl. hyperparameter tuning) | 2.5 hours | 2.3 | 23.0 |
| High-Potential Candidate Selection (Inference) | 0.3 hours | 0.3 | 3.0 |
| Total RF-Related Cost | 14.8 hours | 14.6 | 146.0 |
| Direct Meta-Heuristic Optimization (No RF) | 48.0 hours | 45.2 | 452.0 |
| Reduction Ratio | 69.2% | 67.7% | 67.7% |
Table 5: Spectral Features for Random Forest Surrogate Model
| Feature Name | Abbreviation | Mathematical Definition | Physical Interpretation |
|---|---|---|---|
| Spectral Entropy | SE | , | Measures the uniformity of energy distribution; lower values indicate concentrated energy. |
| Spectral Information Density | SID | Quantifies information content per frequency component; higher values mean richer task-relevant information. | |
| Low/Medium/High Frequency Ratio | LMH-FR | Ratio of energy in three frequency bands (low: , med: , high: ). | |
| Energy Concentration | EC | Proportion of energy covered by top- high-energy components (Section A.5). | |
| Frequency Band Coverage | FBC | frequency of candidate set | Indicates the span of frequency bands; reflects coverage of spectral characteristics. |
| Spectral Crest Factor | SCF | Measures the concentration of energy in a single frequency component; higher values mean stronger peak energy. | |
| Peak-to-Average Power Ratio | PAPR | Quantifies the discrepancy between peak and average power; correlates with signal stability. |
is added to avoid numerical instability in logarithmic operations. All features are normalized to [0, 1] using min-max scaling.