In this study, the investigators aim to determine whether non-invasive autonomic modulation decreases inflammation and complications after thoracic surgery. The investigators will test the hypothesis that low-level transcutaneous vagal nerve stimulation (LLVNS) during major thoracic surgery reduces inflammation and complications, particularly postoperative atrial fibrillation (POAF). This will be a prospective randomized pilot trial of 200 patients undergoing major thoracic surgery including lobectomy, bilobectomy, or pneumonectomy via either video-assisted thoracoscopic (VAT) or open thoracotomy. Patients will be randomized to receive ether a) LLVNS (n=100) or b) sham LLVNS (n=100) during their procedure. All patients will receive standardized anesthetic, surgical, and post-surgical care. The primary outcome in this study will be time to occurrence of in-hospital POAF, which will be compared between groups using Cox proportional hazards models. Secondary outcomes will be ICU and hospital length of stay, postoperative morbidity, postoperative mortality, and serologic markers of inflammation.