To investigate the distribution pattern of traditional Chinese medicine(TCM) syndrome elements in lung cancer patients with epidermal growth factor receptor(EGFR) mutations treated with third-generation targeted therapy(Osimertinib) and to construct a survival prediction model using machine learning and generative large language models(LLM).Methods:Retrospective data from the National Health Big Data Center(2020 to 2023) were collected for newly diagnosed stage Ⅲ to Ⅳ non-small cell lung cancer patients.The dataset was randomly assigned to training(70%) and testing(30%) sets.Descriptive statistical analysis was performed on demographic and TCM syndrome elements.LASSO-Cox regression was used for variable selection,followed by the construction of a Cox proportional hazards model and a nomogram.Model performance was evaluated using the receiver operating characteristic(ROC) curve(area under the curve,AUC) and concordance index(C-index).Additionally,a predictive system based on the Llama architecture generative large language model was developed and compared with traditional machine learning approaches.Results:The predominant TCM syndrome elements were qi deficiency(50.44%),blood stasis(25.01%),and phlegm retention(22.53%).LASSO-Cox regression identified six independent prognostic factors:age,fibrinogen level,CYFRA21-1,comorbid cerebral infarction,family history,and prior first-generation TKI therapy.The multivariate Cox model achieved an AUC of 0.80(95%CI 0.76 to 0.84) in the training set and 0.78(95%CI 0.73 to 0.83) in the testing set,with C-indices of 0.77 and 0.75,respectively.The generative model achieved optimal performance at 40 epochs with a learning rate of 5.00×10-5,yielding 86.6% accuracy,95.7% recall,and an F1-score of 92.8%,significantly outperforming traditional methods.Conclusion:The survival prediction model developed in this study effectively stratifies prognosis risk for EGFR-mutant non-small cell lung cancer patients receiving third-generation targeted therapy and provides novel insights for the prediction method.