Terahertz BIC metasurface design and simulation method and system based on large language model

By transforming BIC metasurface design into a text generation task and combining it with large language models and LoRA technology, the accuracy and flexibility issues in traditional methods are solved, enabling efficient and flexible terahertz device design and reducing training costs.

CN122065682APending Publication Date: 2026-05-19GUILIN UNIV OF ELECTRONIC TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUILIN UNIV OF ELECTRONIC TECH
Filing Date
2026-03-03
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Traditional deep learning methods suffer from accuracy bottlenecks, insufficient design flexibility, and high training costs in BIC metasurface design, making it difficult to meet the design requirements of high precision, flexibility, and cost control.

Method used

The physical parameter design problem is transformed into a text generation problem. By utilizing a large language model and efficient parameter fine-tuning techniques, spectral data is converted into natural language descriptions through signal processing algorithms. A dataset for instruction fine-tuning for forward prediction and reverse design is constructed, and LoRA technology is used to train the large language model to reduce computational resource requirements.

Benefits of technology

It achieves high-precision design scheme generation, can accurately lock narrow parameter ranges, reduces training costs, provides flexible and user-friendly interaction methods, and improves the R&D efficiency of terahertz devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122065682A_ABST
    Figure CN122065682A_ABST
Patent Text Reader

Abstract

The invention discloses a terahertz BIC metasurface design and simulation method and system based on a large language model. In order to solve the problems that a terahertz metasurface based on a continuous domain bound state (BIC) is extremely sensitive to geometric dimensions, and a traditional deep learning regression model is difficult to design accurately due to floating-point number precision limitation and a loss function averaging effect, the invention provides an end-to-end design method taking geometric parameters as natural language sequences. According to the method, high-Q-value spectral features are extracted by using a signal processing algorithm, and a bidirectional instruction fine tuning data set containing forward simulation and reverse design is constructed; a large language model is finely adjusted through the LoRA technology, the precision bottleneck of traditional floating point regression is broken through by means of the one-by-one prediction capacity of the model on digital Token, and precise textualized output of nanoscale sensitive sizes is achieved. The method is especially suitable for the design of an active terahertz super device with a phase singularity characteristic, and supports the flexible definition of the stop band frequency and the Q value constraint through a natural language.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of terahertz photonics and artificial intelligence, and in particular to a method and system for reverse design and forward spectral prediction of metasurface structures based on efficient parameter fine-tuning using a large language model. Background Technology

[0002] Terahertz (THz) technology has attracted much attention due to its enormous potential in fields such as nondestructive testing, high-speed communication, and biomedical imaging. Metasurfaces, as artificially designed two-dimensional electromagnetic materials, can flexibly control terahertz waves with subwavelength precision. Among them, metasurfaces based on bound states in the Continuum (BIC) exhibit unique advantages in realizing ultra-narrowband filtering, high-sensitivity sensing, and nonlinear enhancement because they can generate theoretically infinite quality factors (Q values).

[0003] However, the design and optimization of BIC metasurfaces face significant challenges. First, their superior performance is highly dependent on the geometric parameters of the structure. In the terahertz band, even sub-micron level geometric dimensional deviations (e.g., less than 0.1% of the total structure size) can cause drastic shifts in the resonant frequencies of BIC modes, or even completely eliminate their high Q-value characteristics. This phenomenon, known as "phase singularity," imposes extremely high requirements on design accuracy.

[0004] Traditional electromagnetic simulation software (such as CST and Lumerical FDTD) can accurately calculate the response of metasurfaces, but the process is extremely time-consuming. A single high-precision simulation typically takes several hours or even days, making it difficult to meet the needs of rapid iterative design. To accelerate the design process, researchers have begun to adopt deep learning methods. Traditional reverse engineering models, such as deep neural networks (DNNs) or convolutional neural networks (CNNs), typically model the design problem as a regression task: input the desired spectral curve (or its features), and output the corresponding floating-point values ​​of geometric parameters.

[0005] Despite some progress, regression-based deep learning methods have the following inherent drawbacks when dealing with the design of highly sensitive BIC metasurfaces: (1) Precision limitation: The precision of floating-point numbers (such as 32-bit or 64-bit) in computers is limited, and there may be accumulated errors in network backpropagation and parameter updates, making it difficult to meet the nanometer-level precision required for BIC design. (2) Averaging effect: Regression models generally use mean squared error (MSE) as the loss function, which drives the model prediction results to tend to the "average" of the training data distribution in order to minimize the overall error. For BIC, which exhibits a sharp response with "singularities" in physical laws, the model's prediction results are often smoothed, making it difficult to accurately hit the narrow parameter range where the physical effect is most significant. (3) Poor design flexibility: Traditional models usually require the input to be a vector of fixed dimensions, for example, the user must provide a complete spectral curve. If a user has only a sparse, conceptual design requirement (e.g., “I want an ultra-narrowband filter that works around 0.8 THz”), and no specific requirements for bandwidth, Q value, etc., traditional models cannot directly handle such “incomplete” or “fuzzy” constraints. (4) High training cost: Although fully fine-tuned large language models (LLM) have shown potential in handling complex tasks, their huge computational resources and time costs (usually requiring multiple top-tier GPUs for training for several weeks) limit their application in specific physical design domains.

[0006] In summary, there is an urgent need for a new design paradigm that can meet the ultra-high precision required for BIC metasurface design, provide a flexible and user-friendly interaction method, and keep training costs under control. Summary of the Invention

[0007] The present invention aims to at least partially solve one of the aforementioned technical problems in the related art, particularly the problems of accuracy bottleneck, insufficient design flexibility and high training cost in the design of BIC metasurfaces by traditional deep learning methods.

[0008] To address this, this invention proposes a terahertz BIC metasurface design and simulation method based on a large language model. The core idea is to completely transform the physical parameter design problem into a text generation problem. In this invention, a high-precision geometric parameter (e.g., 10.523 μm) is no longer considered a computer floating-point number, but rather a text sequence composed of characters ["1", "0", ".", "5", "2", "3"]. This paradigm shift fully leverages the powerful capabilities of large language models in sequence data processing.

[0009] This invention proposes a terahertz BIC metasurface design and simulation method based on a large language model, comprising: acquiring original simulation data of a metasurface with BIC characteristics; extracting features from the spectral data using signal processing algorithms and converting them into natural language descriptions, while simultaneously converting geometric parameter values ​​into text token sequences to construct an instruction fine-tuning dataset containing both forward prediction and reverse design tasks; training a pre-trained large language model using parameter-efficient fine-tuning techniques (such as LoRA) to enable it to grasp the physical laws between the metasurface structure and spectral response; and finally, the model can receive natural language instructions or specific parameters from the user to generate high-precision structural design schemes or predict their spectral characteristics.

[0010] This method has the following advantages:

[0011] By increasing the number of tokens generated, values ​​of arbitrary precision can be represented, completely eliminating the hardware limitations of the floating-point bit width of computers.

[0012] Training large language models is based on "predicting the probability of the next word," which is essentially a classification task. For sensitive structures like BIC, the model can "lock in" a precise sequence of numbers with extremely high confidence, rather than outputting an averaged, blurred floating-point value. This allows the design to accurately fall within a narrow parameter range where physical effects are significant.

[0013] Another objective of this invention is to propose a corresponding system. This system utilizes parameter-efficient fine-tuning techniques (such as LoRA) to efficiently inject terahertz domain expertise into a general-purpose large language model using only a very small fraction (typically less than 1%) of the parameters trained in the model. This allows the entire fine-tuning process to be completed on a single consumer-grade graphics card (such as an NVIDIA RTX 4090), significantly lowering the deployment threshold.

[0014] The methods and systems of this invention achieve unprecedented design accuracy and flexibility by modeling physical design problems in a language. It serves not only as a high-precision reverse engineering tool but also as a fast forward physics solver, achieving "one model, multiple uses." Users only need to describe key indicators in simple natural language (such as "design a structure with high Q-value filtering at 0.6 THz") to obtain validated, manufactureable designs, significantly improving the R&D efficiency of advanced photonic devices. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Figure 1 This is a schematic diagram of the overall process of the method according to an embodiment of the present invention.

[0016] Figure 2 This is a schematic diagram illustrating spectral data processing and textualization according to an embodiment of the present invention.

[0017] Figure 3 This is a schematic diagram of the mounting structure of the large language model and LoRA module in an embodiment of the present invention.

[0018] Figure 4 This is a comparison diagram of a reverse design result and simulation verification in an embodiment of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0020] Reference Figure 1 The overall process of the method proposed in this invention mainly includes three stages: data preparation, model training, and inference application.

[0021] Phase 1: Data Preparation (Steps 101-102). First, a parametric scan of a specific type of terahertz BIC metasurface is performed using electromagnetic simulation software (such as CST StudioSuite), generating a large amount of raw data (Step 101). In this embodiment, the metasurface unit structure uses silicon-based materials, and asymmetry parameters are introduced. This is achieved by breaking the structural symmetry, thereby exciting quasi-BIC resonance modes. The scanning geometry includes period, size, thickness, and asymmetry parameters. Each parameter combination corresponds to an S-parameter (transmission / reflection coefficient) spectral curve. Then, the core data processing and textification module (step 102) is entered, which transforms the high-dimensional continuous spectral curves and floating-point geometric parameters into a text format suitable for large language models.

[0022] Phase Two: Model Training (Step 103). Using the constructed bidirectional instruction fine-tuning dataset, the parameters of a pre-trained large language model (e.g., Llama-3.1-8B) are efficiently fine-tuned (Step 103). This embodiment employs the QLoRA technique, which significantly reduces the GPU memory and computational resources required for training through quantization and low-rank decomposition.

[0023] Phase 3: Inference Application (Steps 104-105). After training, the fine-tuned large language model (Step 104) can be used for actual design. Users can input design requirements through an interactive interface (Step 105), such as "Design a structure with a high Q resonance at 0.75 THz". After receiving the instruction, the model will generate a set of high-precision geometric parameter text sequences, which users can use for subsequent simulation verification or actual manufacturing.

[0024] In one embodiment of the present invention, a spectral semantic feature extraction module based on find_peaks is used. Reference Figure 2 This module aims to address the issue that raw spectral data is unsuitable as direct input to LLM. Raw spectra are typically high-dimensional vectors containing hundreds of data points; direct input not only increases computational burden but also makes it difficult for the model to capture key physical meaning.

[0025] This invention utilizes signal processing algorithms to transform physical curves into "semantic symbols." Specifically, it employs the `find_peaks` function from the Python library `scipy.signal`.

[0026] The specific operation involves processing the S21 (transmission coefficient) spectral curve exported from the CST simulation. Figure 2 On the left), a prominence threshold is set to identify all significant dips in the transmission spectrum, i.e., resonance peaks. Figure 2 (Middle). For each identified dip, the program automatically calculates its center frequency. And Full Width at HalfMaximum (FWHM) Subsequently, according to the formula The quality factor Q of the resonance peak was calculated.

[0027] A complex spectral curve is ultimately simplified into a structured natural language description. Figure 2(On the right side), for example: "The spectrum has a resonance peak at 4.2 THz with a Q-factor of 200, and another broad resonance at 5.5 THz with a Q-factor of 30." This description retains the core physical information and conforms to the text processing paradigm of LLM.

[0028] In one embodiment of the present invention, a bidirectional instruction dataset supporting variable constraints is constructed.

[0029] To enable the model to simultaneously possess the capabilities of "forward prediction" and "reverse design" and to handle flexible design requirements, this invention constructs a bidirectional and diverse instruction dataset, adopting a template format similar to Alpaca, which includes three parts: instruction, input, and response.

[0030] For the forward solver task, the dataset simulates a physics solver. A single sample is constructed as follows: * Instruction: "Predict the spectral features for the given structural parameters." * Input: "Unit cell parameters are: P=100um, L=80um, alpha=0.1." * Response: "The spectrum has a resonance peak at 0.8 THz with a Q-factor of 150."

[0031] For inverse design tasks, the on-demand design process is simulated. A single sample is constructed as follows: * Instruction: "Design a unit cell that meets the following spectral requirements." * Input: "A resonance peak at 0.8 THz with a Q-factor of 150." * Response: "Unit cell parameters are: P=100um, L=80um, alpha=0.1."

[0032] To enable the model to learn to handle incomplete user requirements, when constructing reverse task data, multiple input descriptions with different levels of detail are randomly generated for the same physical sample (i.e., the correspondence between the same set of structures and spectra). * Template A (Fully Constrained): "Design a unit cell with a resonance at 0.45 THz and a Q-factor of 50." * Template B (Relaxed Constraints): "Design a unit cell resonating at 0.45 THz." (Q-value information omitted)

[0033] By training on such mixed datasets, the model can learn the inherent connections between physical laws. When the user only provides frequency constraints, the model can automatically infer and match a reasonable range of Q values ​​to complete the design based on the general laws learned from the training data.

[0034] In one embodiment of the present invention, LoRA-based model parameter training is performed.

[0035] Reference Figure 3 This module aims to inject domain knowledge into models in a low-cost manner. Figure 3 This demonstrates a hierarchical structure of the Transformer model, where the LoRA module is injected into the key self-attention sublayer.

[0036] This embodiment uses the PyTorch deep learning framework and combines it with open-source libraries such as unsloth to achieve an efficient QLoRA training process. Taking the Llama-3.1-8B model as an example, the LoRA adapter is selectively injected into all its attention weight matrices, such as the query (q_proj), key (k_proj), value (v_proj), and output (o_proj) matrices.

[0037] The rank of a low-rank matrix is ​​a key hyperparameter; in this embodiment, the rank is set to 16. For example... Figure 3 As shown, the original weight matrix Keep the system frozen during training, with only low-rank matrices injected via bypass. and It is trainable. This reduces the total number of trainable parameters to less than 1% of the original model. Thanks to this, the hardware requirements for the entire fine-tuning task have been significantly reduced. Training that previously required multi-GPU servers can now be completed in a few hours on a single consumer-grade graphics card such as an NVIDIA RTX 5090. In one embodiment of the present invention, reverse design results are verified.

[0038] Reference Figure 4 To verify the effectiveness of the method of this invention, a reverse design test was conducted. The user input target was a filter with multiple high-Q stopbands ( Figure 4 The target (represented by dashed lines) has center frequencies of 0.526 THz, 0.5425 THz, and 0.547 THz. After receiving the target description, the fine-tuned model outputs a set of geometric parameters. These parameters, generated by the model, are then input into the CST electromagnetic simulation software for verification, and the resulting simulated spectrum is shown below. Figure 4 The solid line in the middle represents "Generated". from Figure 4 As can be clearly seen, the spectrum of the model-generated structure is highly consistent with the spectrum of the user target in terms of resonant frequency and Q value, proving the effectiveness and accuracy of the method of the present invention in high-precision reverse design. In summary, this invention innovatively transforms the metasurface design problem into a text generation task and combines it with efficient parameter fine-tuning technology, successfully overcoming the multiple limitations of traditional methods in terms of accuracy, flexibility, and cost. This provides a new and effective technical path for the intelligent and automated design of high-performance terahertz devices.

[0039] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A design and simulation method for terahertz BIC metasurfaces based on a large language model, characterized in that, Includes the following steps: Obtain the original simulation data of the terahertz metasurface with continuous domain bound state (BIC) characteristics. The original simulation data includes geometric parameters and corresponding spectral response data. The spectral response data is characterized and transformed into a natural language description containing key physical features; at the same time, the values ​​of the geometric structure parameters are transformed into discrete text token sequences, thereby constructing a bidirectional instruction fine-tuning dataset containing forward prediction tasks and reverse design tasks. The pre-trained large language model is fine-tuned using the low-rank adaptive (LoRA) technique. Specifically, the backbone network parameters of the pre-trained large language model are frozen, a trainable side network composed of low-rank decomposition matrices is injected into one or more attention modules in the Transformer layer that constitutes the model, and the side network is trained using the bidirectional instruction fine-tuning dataset. Responding to users' non-fixed format design requests input in the form of natural language or structural parameters, the system uses a finely tuned large language model for reasoning to output the corresponding metasurface structure design scheme or predict its spectral characteristics.

2. The method according to claim 1, characterized in that, The terahertz metasurface is a BIC metasurface based on an all-dielectric material, and its transmission spectrum contains quasi-BIC (Q-value) resonance modes induced by symmetry breaking or parameter tuning; small changes in the geometric parameters can cause significant abrupt changes in the Q-value or center frequency of the resonance modes.

3. The method according to claim 1, characterized in that, The step of characterizing the spectral response data specifically includes: A signal peak detection algorithm is used to process the simulated spectral curves to identify one or more transmission extreme points; Calculate the center frequency and 3dB bandwidth corresponding to each extreme point, and derive the corresponding quality factor (Q value) according to the preset formula. The continuous spectral curve data is discretized into one or more sequences of physical feature tuples consisting of center frequency, Q value, and extreme point depth, and then arranged into a natural language description.

4. The method according to claim 1, characterized in that, The step of converting the numerical values ​​of the geometric structure parameters into a discrete text token sequence is specifically as follows: Each numeric character and decimal point character in the floating-point number representing geometric parameters is treated as an independent, vocabulary-indexable text token. During model fine-tuning, the Cross-Entropy Loss function is used to optimize the model, enabling the model to predict the character sequence constituting the geometric parameters one token at a time in the form of a text generation classification task. This avoids the numerical precision truncation error introduced by floating-point regression prediction and the average effect of prediction results caused by the mean squared error loss function (MSE Loss).

5. The method according to claim 1, characterized in that, The steps for fine-tuning using low-rank adaptive (LoRA) technology are as follows: For the selected weight matrix in the model The amount of updates during the training process Decomposed into two low-rank matrices and The product of, i.e. , where the matrix and rank much smaller Dimensions.

6. The method according to claim 1, characterized in that, The step of reasoning using the fine-tuned large language model has the ability to handle variable constraints, including: When a user input containing only the target resonant frequency is received, the model automatically infers and matches one or more potential Q values ​​and generates a structural design scheme that satisfies the frequency constraint. When a user input containing both target resonant frequency and Q-value constraints is received, the model generates a structural design scheme that satisfies both physical quantity constraints. When the model receives complete structural parameters from the user, it performs a forward prediction task and outputs a natural language description of the resonance mode corresponding to the structure.

7. A terahertz BIC metasurface design and simulation system based on a large language model, characterized in that, include: The data processing and construction module is used to acquire the original simulation data of the terahertz metasurface with continuous domain bound state (BIC) characteristics, and to characterize the spectral response data into natural language descriptions and convert the geometric structure parameter values ​​into text token sequences to construct a bidirectional instruction fine-tuning dataset. The model efficient fine-tuning module is used to fine-tune the pre-trained large language model using low-rank adaptive (LoRA) technology. It achieves efficient injection of domain knowledge by injecting and training only low-rank decomposition matrices into the model. The reasoning and interaction module is used to receive users' non-fixed format design requirements and call the fine-tuned large language model to generate metasurface structure design schemes that meet user requirements or predict their spectral characteristics.