Large language model data set construction and model training method for optical thin film design
By constructing a large language model dataset for optical thin film design and combining it with global and local optimization training, the problem of low efficiency in existing technologies is solved, and efficient and accurate correlation of optical thin film design is achieved, meeting the needs of refined design in complex spectral scenarios.
Patent Information
- Application Number
- CN202511362541.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-23
- Publication Date
- 2026-01-13
AI Technical Summary
Existing optical thin film design technologies are inefficient and cannot meet the requirements for refined design in complex spectral scenarios. Furthermore, existing data structures cannot fully characterize the actual thin film structure information, resulting in a gap between design and actual manufacturing.
We construct a large language model dataset for optical thin film design based on real production processes, and train a private large model through a combination of global and local optimization to achieve accurate correlation between optical thin film production process parameters and actual measured spectral characteristics.
It achieves efficient and precise correlation in optical thin film design, and can provide efficient thin film design solutions for each real machine tool condition, thereby improving design efficiency and spectral control accuracy.
Smart Images

Figure CN121328279A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the cross technical field of optical film design and large language model, and specifically relates to a large language model data set construction and model training method for optical film design. BACKGROUND
[0002] As a core technology in the field of optical engineering, the performance of optical film design directly determines the spectral regulation capability of optical elements. Traditional optical film design relies on precise physical simulation and manual experience optimization, and needs to be completed through iterative calculation or manual rules such as the transfer matrix method, which is not only low in efficiency, but also difficult to meet the fine design requirements in complex spectral scenarios.
[0003] In order to improve the efficiency and spectral regulation accuracy of optical film design, deep learning and large language model technology have become a new idea for optical film design. However, the current technology faces key problems such as incompatible data representation system, mismatched model input dimension and missing physical constraint modeling. Optical film design is based on the response relationship between long-sequence film system structure and two-dimensional spectral function. The limitations of existing data structures make it difficult to achieve unified representation.
[0004] At the same time, the existing optical film data set lacks some information. The physical constraint conditions such as material dispersion characteristics and substrate parameters are not systematically integrated into the data structure; a series of actual problems such as uncontrollable process deviation in actual production and manufacturing lead to a large gap between film design and actual manufacturing. Therefore, the current existing technology has not formed an efficient data structure and accurate modeling method that integrates physical constraints, and it is difficult to meet the intelligent design requirements of optical films.
[0005] Therefore, a large language model data set construction and model training method for optical film design is provided. SUMMARY
[0006] To solve the above problems in the prior art, the application provides a large language model data set construction and model training method for optical film design, which trains a private large model for film design that matches the actual production process, realizes the accurate correlation between the optical film production process parameters and the actual measured spectral characteristics, and solves the practical problem that the existing data structure cannot fully represent the real film structure information.
[0007] The technical solution to achieve the above purpose is:
[0008] The large language model data set construction and model training method for optical film design comprises:
[0009] Step S1, based on the design layered structure of the optical film structure and the generated spectral data, a specific data set based on the actual production situation is generated;
[0010] Step S2, using the training and fine-tuning dataset of the large language model, training a thin film design private large model matched with the actual production process;
[0011] Step S3, based on the characteristics of the large language model input, the thin film design private large model training scheme is divided into global design optimization and local design optimization;
[0012] Step S4, the global optimization and local optimization are combined to train the model.
[0013] Preferably, in step S1, the specific dataset is preprocessed, including data cleaning, text conversion, question and answer template, dataset segmentation and scale expansion.
[0014] Preferably, in step S3, the local optimization training uses a local optimization dataset;
[0015] The global optimization training uses a global dataset;
[0016] The local optimization uses a scheme of real thin film structure matrix sequence corresponding to the spectrum matrix;
[0017] The global optimization uses a scheme of natural language description and key feature extraction.
[0018] Preferably, in step S4, the local optimization is based on the characteristics of optical thin film design itself. In the physical layer, the optical thin film structure is a one-dimensional structure composed of multiple layers of different materials, represented as a 2-row n-column matrix:
[0019]
[0020] In the formula, [n1n2n3…n n ] represents the refractive index of different materials, [d1d2d3…d n ] represents the thickness of each layer of material, and the material and thickness between two layers are one-to-one corresponding, thereby completely characterizing the thin film design structure.
[0021] Preferably, in step S4, based on the characteristics of the large language model and the use dataset, the refractive index and thickness values in the 2-row n-column matrix are normalized:
[0022] The refractive index normalization formula is:
[0023]
[0024] In the formula, n_norm is the normalized refractive index, n is the current refractive index, which is used to bring into the normalization formula, n min is the minimum refractive index, n max is the maximum refractive index;
[0025] The thickness normalization formula is:
[0026]
[0027] In the formula, d norm is the normalized thickness, d is the current thickness, d min is the minimum thickness, and d max is the maximum thickness. min max
[0028] In the step S4, the transmittance and reflectance characteristics of the film are preferably achieved based on the film system design to obtain the spectral response of the entire film, where the spectral response matrix is as follows:
[0029]
[0030] In the formula, [λ1λ2λ3…λ k ] represents k equal divisions of the wavelength range, where the number k depends on the wavelength range and the grid accuracy, [T1T2T3…T k ] represents the transmittance at the kth wavelength, and [R1R2R3…R k ] represents the reflectance at the kth wavelength.
[0031] In the step S4, the spectral response preferably divides the wavelength range into k equal parts, where the formula for k is as follows:
[0032]
[0033] In the formula, Lambda_End is the end wavelength, Lambda_Start is the start wavelength, and Step_Index is the step size of the grid.
[0034] Based on the physical principle, the following mandatory constraints are imposed on the spectral response matrix to ensure energy conservation:
[0035] T + R ≤ 1.
[0036] In the step S4, based on the above processing, two normalized matrices and the corresponding relationship between them can be obtained.
[0037]
[0038] A loss function is defined to evaluate the difference between the output value of the model and the target value, where each transmittance difference is summed and each reflectance difference is summed. The loss function is defined as follows:
[0039]
[0040] In the formula, T is the output transmittance, T target is the target transmittance, R is the output reflectance, and R target For the target reflectivity, a is the weight coefficient of the transmittance fitting, β is the weight coefficient of the reflectivity fitting, and γ is the penalty coefficient.
[0041] Preferably, in the step S4, the global optimization adopts a scheme of natural language description and key feature extraction, and the key features are divided into film design end feature parameters and optical response end feature parameters, wherein,
[0042] The film design end feature parameters include but are not limited to: number of layers, average thickness, thickness standard deviation, average refractive index, refractive index standard deviation, total optical thickness and summary of layer sequence;
[0043] The optical response end feature parameters include but are not limited to: peak transmittance and its wavelength, minimum transmittance and its wavelength, average transmittance, full width at half maximum, bandwidth and transmittance at a specific wavelength point.
[0044] Preferably, in the step S4, a corresponding private model is trained for each machine, and an efficient film design scheme for each real machine working condition is realized.
[0045] Compared with the prior art, the present application has the beneficial effects that: the present application provides a large language model training method for optical film design, solves the practical problem that the existing data structure cannot comprehensively represent real film structure information, and based on the data set of the mutual question and answer pairs of real process parameters and actual production results, the large language model is trained and fine-tuned, so as to train a private large model of the film design matched with the actual production process, realize the precise correlation between the optical film production process parameters and the actual measured spectral characteristics, and with the accumulation of the data set and the training and fine-tuning of the large model, a corresponding private model can be trained for each machine, and finally an efficient film design scheme for each real machine working condition is realized. BRIEF DESCRIPTION OF DRAWINGS
[0046] The accompanying drawings are used to provide a further understanding of the present application, and constitute a part of the specification, together with the embodiments of the present application, to explain the present application, and do not constitute a limitation on the present application. In the drawings:
[0047] Figure 1 is a flowchart of the large language model data set construction and model training method for optical film design of the present application. DETAILED DESCRIPTION
[0048] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0049] As Figure 1 shown, the optical film design large language model dataset construction and model training method includes:
[0050] Step S1, based on the design of the layered structure of the optical film structure and the generated spectrum data, a specific dataset based on real production conditions is generated.
[0051] In the embodiment, the specific dataset is preprocessed, including:
[0052] Data cleaning: ensure matrix alignment (each structure matrix corresponds to a spectrum matrix), handle missing values.
[0053] Text conversion: for each sample, apply global optimization and layout optimization scheme.
[0054] Question and answer template: use natural language templates to make text more "human readable" and improve the generalization ability of large language models. For example: input template: "Given the film structure: {structure text}, what are the transmission spectrum characteristics of this structure?" Output template: "Transmission spectrum characteristics: {spectrum text}"
[0055] Dataset segmentation: divided into training set, validation set, test set (number: 80-10-10).
[0056] Scale expansion: after collecting a large number of samples, the dataset can be used to fine-tune the large language model.
[0057] Step S2, using the training and fine-tuning dataset of the large language model, a private large model of the film design matching the actual production process is trained.
[0058] In a specific embodiment, the training and fine-tuning dataset of the large language model includes:
[0059] Dataset file: stored as a.jsonl file, one question and answer pair per line.
[0060] Training task: fine-tune the large language model (such as GPT-3, Qwen) for conditional text generation. The input is the question (structure description), and the output is the answer (spectrum description). The training goal is to minimize the loss value of the output text.
[0061] Prompt engineering: during training, add system prompts to enhance context, for example: "You are an optical film expert. According to the input film structure, predict the output spectrum characteristics."
[0062] Handle long sequences: if using the original list, set the maximum sequence length of the LLM (such as: 2048 tokens), and truncate or block. Use position encoding or sparse attention mechanism optimization.
[0063] Data augmentation: increase sample diversity, e.g.: generate similar structure (small perturbation) spectral data (use thin film simulation software such as TFCalc). Add noise to the matrix to improve robustness.
[0064] Tool selection: Python library: use NumPy / Pandas to process matrix conversion, use json library to generate JSONL. LLM framework: Hugging Face Transformers (training), LangChain (prompt management).
[0065] Step S3, based on the characteristics of large language model input, the thin film design private large model training scheme is divided into global design optimization and local design optimization.
[0066] In the embodiment, the local optimization training adopts the local optimization data set;
[0067] The global optimization training adopts the global data set;
[0068] The local optimization adopts the scheme of real thin film structure matrix sequence corresponding to the spectral matrix;
[0069] The global optimization adopts the scheme of natural language description and key feature extraction.
[0070] Step S4, the global optimization and the local optimization are combined to train the model.
[0071] In the embodiment, the local optimization is based on the characteristics of optical thin film design itself. In the physical layer, the optical thin film structure is a one-dimensional structure composed of multiple layers of different materials, represented as a 2-row n-column matrix:
[0072]
[0073] In the formula, [n1n2n3…n n ] represents the refractive index of different materials, [d1d2d3…d n ] represents the thickness of each layer of material, and the material and thickness between two layers are one-to-one corresponding, thereby completely characterizing the thin film design structure.
[0074] In the embodiment, based on the characteristics of large language model and data set, the refractive index and thickness values in the 2-row n-column matrix are normalized:
[0075] The refractive index normalization formula is:
[0076]
[0077] In the formula, n_norm is the normalized refractive index, n is the current refractive index, which is used to bring into the normalization formula, n minn_min is the minimum refractive index max n_max is the maximum refractive index
[0078] The thickness normalization formula is:
[0079]
[0080] In the formula, d_norm is the normalized thickness, d is the current thickness, d min d_min is the minimum thickness max d_max is the maximum thickness
[0081] In the embodiment, based on the film system design, the transmission and reflection characteristics of the thin film are realized to obtain the spectral response of the entire thin film, wherein the spectral response matrix is as follows:
[0082]
[0083] In the formula, [λ1λ2λ3…λ k ] represents that the wavelength range is divided into k equal parts, the number of k depends on the wavelength range and the grid accuracy, [T1T2T3…T k ] represents the transmittance at the kth wavelength, [R1R2R3…R k ] represents the reflectance at the kth wavelength.
[0084] In the embodiment, the spectral response divides the wavelength range into k equal parts, and the formula of k is as follows:
[0085]
[0086] In the formula, Lambda_End is the end wavelength, Lambda_Step is the start wavelength, and Step_Index is the step length of the grid;
[0087] Based on the physical principle, the following forced constraint conditions are obtained in the spectral response matrix to ensure energy conservation:
[0088] T+R≤1.
[0089] In the embodiment, based on the above processing, two normalized matrices and the corresponding relationship between them can be obtained:
[0090]
[0091] Define a loss function to evaluate the difference between the output value and the target value of the model, sum each transmission difference and sum each reflection difference. The loss function is defined as follows:
[0092]
[0093] In the formula, T is the output transmittance, Ttarget R is the target transmittance, and R is the output reflectance. target Let α be the target reflectance, β be the weighting coefficient for the transmittance fitting, and γ be the penalty coefficient.
[0094] In this embodiment, global optimization is described using natural language, and the key feature extraction scheme is divided into thin film design-side feature parameters and optical response-side feature parameters.
[0095] Thin film design features include, but are not limited to: number of layers, average thickness, thickness standard deviation, average refractive index, refractive index standard deviation, total optical thickness, and a summary of the layer sequence (such as the thickness / refractive index of the first three layers and the last three layers).
[0096] Optical response end characteristic parameters include, but are not limited to: peak transmittance and its wavelength, minimum transmittance and its wavelength, average transmittance, full width at half maximum (FWHM, if the spectrum has peaks), bandwidth, and transmittance at a specific wavelength point.
[0097] In this embodiment, a corresponding private model is trained for each machine to achieve an efficient thin film design scheme for each real machine operating condition.
[0098] Finally, it should be noted that the above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for constructing and training a large language model dataset for optical thin film design, characterized in that, include: Step S1: Based on the design of the layered structure of the optical thin film structure and the resulting spectral data, generate a specific dataset based on the actual production situation; Step S2: Using the training and fine-tuning dataset of the large language model, a private large model for thin film design that matches the actual production process is trained. Step S3: Based on the characteristics of the large language model input, the thin film design privatized large model training scheme is divided into global design optimization and local design optimization; Step S4 involves training the model by combining global and local optimization methods.
2. The method for constructing a large language model dataset and training a model for optical thin film design according to claim 1, characterized in that, In step S1, preprocessing operations are performed on the specific dataset, including: data cleaning, text conversion, question-and-answer templates, dataset segmentation, and scale expansion.
3. The method for constructing a large language model dataset and training a model for optical thin film design according to claim 1, characterized in that, In step S3, the local optimization training uses a local optimization dataset; Global optimization training uses a global dataset; Local optimization employs a scheme that uses the spectral matrix corresponding to the actual thin film structure matrix sequence; The global optimization uses natural language description and a key feature extraction scheme.
4. The method for constructing a large language model dataset and training a model for optical thin film design according to claim 1, characterized in that, In step S4, the local optimization is based on the inherent characteristics of the optical thin film design. At the physical level, the optical thin film structure is a one-dimensional structure composed of multiple layers of different materials, represented as a 2xn matrix: In the formula, [n1n2n3…n n [d1d2d3…d] represents the refractive index of different materials. n The thickness of each layer of material is represented by the symbol ], and there is a one-to-one correspondence between the material and thickness of two layers, thus fully characterizing the thin film design structure.
5. The method for constructing a large language model dataset and training a model for optical thin film design according to claim 4, characterized in that, In step S4, based on the characteristics of the large language model and the dataset used, the refractive index and thickness values in the 2xn matrix are normalized: The formula for normalizing the refractive index is: In the formula, n_norm is the normalized refractive index, and n is the current refractive index, used to substitute into the normalization formula. min For the minimum refractive index, n max Maximum refractive index; The thickness normalization formula is: In the formula, d_norm is the normalized thickness, and d is the current thickness, used to substitute into the normalization formula. min For minimum thickness, d max This is the maximum thickness.
6. The method for constructing a large language model dataset and training a model for optical thin film design according to claim 4, characterized in that, In step S4, based on the film system design, the transmission and reflection characteristics of the thin film are realized, thereby obtaining the spectral response of the entire thin film. The spectral response matrix is as follows: In the formula, [λ1λ2λ3…λ k [T1T2T3…T] indicates that the wavelength range has been divided into k equal parts, where the number of k depends on the wavelength range and the grid precision. k [R1R2R3…R] represents the transmittance at the k-th wavelength. k ] represents the reflectivity at the k-th wavelength.
7. The method for constructing a large language model dataset and training a model for optical thin film design according to claim 6, characterized in that, In step S4, the spectral response divides the wavelength range into k equal parts, where k is calculated using the following formula: In the formula, Lambda_End is the termination wavelength, Lambda_Step is the starting wavelength, and Step_Index is the step size of the grid. Based on physical principles, the spectral response matrix has the following mandatory constraints to ensure energy conservation: T+R≤1.
8. The method for constructing a large language model dataset and training a model for optical thin film design according to claim 7, characterized in that, In step S4, based on the above processing, two normalized matrices and the correspondence between them can be obtained: A loss function is defined to evaluate the difference between the model's output value and the target value. The loss function is defined as follows: (Sum of each transmission difference and each reflection difference is then calculated.) In the formula, T is the output transmittance, T target R is the target transmittance, and R is the output reflectance. target Let α be the target reflectance, β be the weighting coefficient for the transmittance fitting, and γ be the penalty coefficient.
9. The method for constructing a large language model dataset and training a model for optical thin film design according to claim 1, characterized in that, In step S4, the global optimization is described using natural language, and a key feature extraction scheme is used. The key features are divided into thin-film design feature parameters and optical response feature parameters. Thin film design features include, but are not limited to: number of layers, average thickness, thickness standard deviation, average refractive index, refractive index standard deviation, total optical thickness, and a summary of the layer sequence. The optical response end characteristic parameters include, but are not limited to: peak transmittance and its wavelength, minimum transmittance and its wavelength, average transmittance, full width at half maximum (FWHM), bandwidth, and transmittance at a specific wavelength point.
10. The method for constructing a large language model dataset and training a model for optical thin film design according to claim 1, characterized in that, In step S4, a corresponding private model is trained for each machine tool to achieve an efficient thin film design scheme for each real machine tool operating condition.
Citation Information
Cited By
Multi-layer thin film spectrum inversion model training method based on small sample migration, multi-layer thin film spectrum inversion method, device and medium
CN121723181A