writeup: NeurIPS quarto scaffold + paper/paper-html recipes

docs/writeup/paper.qmd (2pp NeurIPS), references.bib, neurips_2023.sty, the
quarto _extensions. justfile gains `paper` (latex) and `paper-html` (no latex)
recipes. gitignore the generated paper.pdf/paper.tex and the transient .claude/.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
This commit is contained in:
wassname
2026-06-05 06:36:14 +08:00
parent 4e802bb3ab
commit 7db5a56cb1
12 changed files with 1148 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
# quarto + latex build artifacts; only paper.qmd, references.bib, _extensions/ are source
paper.pdf
paper.tex
paper.html
paper_files/
/.quarto/
*.aux
*.log
*.bbl
*.blg
*.out
*.fls
*.fdb_latexmk
@@ -0,0 +1,51 @@
title: NeruIPS 2023 Template
author: Shao-Ting Chiu
version: 0.1.0
contributes:
formats:
pdf:
# define default configuration for the pdf version of your format
documentclass: article
papersize: letter
cite-method: natbib
number-sections: true
pdf-engine: pdflatex
toc: false
# Set this below (`biblio-config: false`) if your cls already load a bst file
# biblio-config: false
# Content to add in header that your format is using
header-includes: |
\usepackage[nonatbib, preprint]{neurips_2023}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage[utf8]{inputenc} % allow utf-8 input
\usepackage[T1]{fontenc} % use 8-bit T1 fonts
\usepackage{hyperref} % hyperlinks
\usepackage{url} % simple URL typesetting
\usepackage{booktabs} % professional-quality tables
\usepackage{amsfonts} % blackboard math symbols
\usepackage{nicefrac} % compact symbols for 1/2, etc.
\usepackage{microtype} % microtypography
\usepackage{xcolor} % colors
\usepackage{comment}
\usepackage{graphicx}
\bibliographystyle{abbrvnat}
\newtheorem{lemma}{Lemma}
template-partials:
# Add here the partials your format is using
- "partials/graphics.tex"
- "partials/before-body.tex"
- "partials/title.tex"
- "partials/_authors.tex"
format-resources:
# Add here the resources required for the PDF rendering
- neurips_2023.sty
html:
# define default configuration for the html version of your format
number-sections: true
toc: true
source: true
# Use a CSL file to style (https://www.zotero.org/styles/)
csl: https://www.zotero.org/styles/ieee
@@ -0,0 +1,375 @@
% partial rewrite of the LaTeX2e package for submissions to the
% Conference on Neural Information Processing Systems (NeurIPS):
%
% - uses more LaTeX conventions
% - line numbers at submission time replaced with aligned numbers from
% lineno package
% - \nipsfinalcopy replaced with [final] package option
% - automatically loads times package for authors
% - loads natbib automatically; this can be suppressed with the
% [nonatbib] package option
% - adds foot line to first page identifying the conference
% - adds preprint option for submission to e.g. arXiv
% - conference acronym modified
%
% Roman Garnett (garnett@wustl.edu) and the many authors of
% nips15submit_e.sty, including MK and drstrip@sandia
%
% last revision: March 2023
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{neurips_2023}[2023/03/31 NeurIPS 2023 submission/camera-ready style file]
% declare final option, which creates camera-ready copy
\newif\if@neuripsfinal\@neuripsfinalfalse
\DeclareOption{final}{
\@neuripsfinaltrue
}
% declare nonatbib option, which does not load natbib in case of
% package clash (users can pass options to natbib via
% \PassOptionsToPackage)
\newif\if@natbib\@natbibtrue
\DeclareOption{nonatbib}{
\@natbibfalse
}
% declare preprint option, which creates a preprint version ready for
% upload to, e.g., arXiv
\newif\if@preprint\@preprintfalse
\DeclareOption{preprint}{
\@preprinttrue
}
\ProcessOptions\relax
% determine whether this is an anonymized submission
\newif\if@submission\@submissiontrue
\if@neuripsfinal\@submissionfalse\fi
\if@preprint\@submissionfalse\fi
% fonts
\renewcommand{\rmdefault}{ptm}
\renewcommand{\sfdefault}{phv}
% change this every year for notice string at bottom
\newcommand{\@neuripsordinal}{37th}
\newcommand{\@neuripsyear}{2023}
\newcommand{\@neuripslocation}{New Orleans}
% acknowledgments
\usepackage{environ}
\newcommand{\acksection}{\section*{Acknowledgments and Disclosure of Funding}}
\NewEnviron{ack}{%
\acksection
\BODY
}
% load natbib unless told otherwise
\if@natbib
\RequirePackage{natbib}
\fi
% set page geometry
\usepackage[verbose=true,letterpaper]{geometry}
\AtBeginDocument{
\newgeometry{
textheight=9in,
textwidth=5.5in,
top=1in,
headheight=12pt,
headsep=25pt,
footskip=30pt
}
\@ifpackageloaded{fullpage}
{\PackageWarning{neurips_2023}{fullpage package not allowed! Overwriting formatting.}}
{}
}
\widowpenalty=10000
\clubpenalty=10000
\flushbottom
\sloppy
% font sizes with reduced leading
\renewcommand{\normalsize}{%
\@setfontsize\normalsize\@xpt\@xipt
\abovedisplayskip 7\p@ \@plus 2\p@ \@minus 5\p@
\abovedisplayshortskip \z@ \@plus 3\p@
\belowdisplayskip \abovedisplayskip
\belowdisplayshortskip 4\p@ \@plus 3\p@ \@minus 3\p@
}
\normalsize
\renewcommand{\small}{%
\@setfontsize\small\@ixpt\@xpt
\abovedisplayskip 6\p@ \@plus 1.5\p@ \@minus 4\p@
\abovedisplayshortskip \z@ \@plus 2\p@
\belowdisplayskip \abovedisplayskip
\belowdisplayshortskip 3\p@ \@plus 2\p@ \@minus 2\p@
}
\renewcommand{\footnotesize}{\@setfontsize\footnotesize\@ixpt\@xpt}
\renewcommand{\scriptsize}{\@setfontsize\scriptsize\@viipt\@viiipt}
\renewcommand{\tiny}{\@setfontsize\tiny\@vipt\@viipt}
\renewcommand{\large}{\@setfontsize\large\@xiipt{14}}
\renewcommand{\Large}{\@setfontsize\Large\@xivpt{16}}
\renewcommand{\LARGE}{\@setfontsize\LARGE\@xviipt{20}}
\renewcommand{\huge}{\@setfontsize\huge\@xxpt{23}}
\renewcommand{\Huge}{\@setfontsize\Huge\@xxvpt{28}}
% sections with less space
\providecommand{\section}{}
\renewcommand{\section}{%
\@startsection{section}{1}{\z@}%
{-2.0ex \@plus -0.5ex \@minus -0.2ex}%
{ 1.5ex \@plus 0.3ex \@minus 0.2ex}%
{\large\bf\raggedright}%
}
\providecommand{\subsection}{}
\renewcommand{\subsection}{%
\@startsection{subsection}{2}{\z@}%
{-1.8ex \@plus -0.5ex \@minus -0.2ex}%
{ 0.8ex \@plus 0.2ex}%
{\normalsize\bf\raggedright}%
}
\providecommand{\subsubsection}{}
\renewcommand{\subsubsection}{%
\@startsection{subsubsection}{3}{\z@}%
{-1.5ex \@plus -0.5ex \@minus -0.2ex}%
{ 0.5ex \@plus 0.2ex}%
{\normalsize\bf\raggedright}%
}
\providecommand{\paragraph}{}
\renewcommand{\paragraph}{%
\@startsection{paragraph}{4}{\z@}%
{1.5ex \@plus 0.5ex \@minus 0.2ex}%
{-1em}%
{\normalsize\bf}%
}
\providecommand{\subparagraph}{}
\renewcommand{\subparagraph}{%
\@startsection{subparagraph}{5}{\z@}%
{1.5ex \@plus 0.5ex \@minus 0.2ex}%
{-1em}%
{\normalsize\bf}%
}
\providecommand{\subsubsubsection}{}
\renewcommand{\subsubsubsection}{%
\vskip5pt{\noindent\normalsize\rm\raggedright}%
}
% float placement
\renewcommand{\topfraction }{0.85}
\renewcommand{\bottomfraction }{0.4}
\renewcommand{\textfraction }{0.1}
\renewcommand{\floatpagefraction}{0.7}
\newlength{\@neuripsabovecaptionskip}\setlength{\@neuripsabovecaptionskip}{7\p@}
\newlength{\@neuripsbelowcaptionskip}\setlength{\@neuripsbelowcaptionskip}{\z@}
\setlength{\abovecaptionskip}{\@neuripsabovecaptionskip}
\setlength{\belowcaptionskip}{\@neuripsbelowcaptionskip}
% swap above/belowcaptionskip lengths for tables
\renewenvironment{table}
{\setlength{\abovecaptionskip}{\@neuripsbelowcaptionskip}%
\setlength{\belowcaptionskip}{\@neuripsabovecaptionskip}%
\@float{table}}
{\end@float}
% footnote formatting
\setlength{\footnotesep }{6.65\p@}
\setlength{\skip\footins}{9\p@ \@plus 4\p@ \@minus 2\p@}
\renewcommand{\footnoterule}{\kern-3\p@ \hrule width 12pc \kern 2.6\p@}
\setcounter{footnote}{0}
% paragraph formatting
\setlength{\parindent}{\z@}
\setlength{\parskip }{5.5\p@}
% list formatting
\setlength{\topsep }{4\p@ \@plus 1\p@ \@minus 2\p@}
\setlength{\partopsep }{1\p@ \@plus 0.5\p@ \@minus 0.5\p@}
\setlength{\itemsep }{2\p@ \@plus 1\p@ \@minus 0.5\p@}
\setlength{\parsep }{2\p@ \@plus 1\p@ \@minus 0.5\p@}
\setlength{\leftmargin }{3pc}
\setlength{\leftmargini }{\leftmargin}
\setlength{\leftmarginii }{2em}
\setlength{\leftmarginiii}{1.5em}
\setlength{\leftmarginiv }{1.0em}
\setlength{\leftmarginv }{0.5em}
\def\@listi {\leftmargin\leftmargini}
\def\@listii {\leftmargin\leftmarginii
\labelwidth\leftmarginii
\advance\labelwidth-\labelsep
\topsep 2\p@ \@plus 1\p@ \@minus 0.5\p@
\parsep 1\p@ \@plus 0.5\p@ \@minus 0.5\p@
\itemsep \parsep}
\def\@listiii{\leftmargin\leftmarginiii
\labelwidth\leftmarginiii
\advance\labelwidth-\labelsep
\topsep 1\p@ \@plus 0.5\p@ \@minus 0.5\p@
\parsep \z@
\partopsep 0.5\p@ \@plus 0\p@ \@minus 0.5\p@
\itemsep \topsep}
\def\@listiv {\leftmargin\leftmarginiv
\labelwidth\leftmarginiv
\advance\labelwidth-\labelsep}
\def\@listv {\leftmargin\leftmarginv
\labelwidth\leftmarginv
\advance\labelwidth-\labelsep}
\def\@listvi {\leftmargin\leftmarginvi
\labelwidth\leftmarginvi
\advance\labelwidth-\labelsep}
% create title
\providecommand{\maketitle}{}
\renewcommand{\maketitle}{%
\par
\begingroup
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
% for perfect author name centering
\renewcommand{\@makefnmark}{\hbox to \z@{$^{\@thefnmark}$\hss}}
% The footnote-mark was overlapping the footnote-text,
% added the following to fix this problem (MK)
\long\def\@makefntext##1{%
\parindent 1em\noindent
\hbox to 1.8em{\hss $\m@th ^{\@thefnmark}$}##1
}
\thispagestyle{empty}
\@maketitle
\@thanks
\@notice
\endgroup
\let\maketitle\relax
\let\thanks\relax
}
% rules for title box at top of first page
\newcommand{\@toptitlebar}{
\hrule height 4\p@
\vskip 0.25in
\vskip -\parskip%
}
\newcommand{\@bottomtitlebar}{
\vskip 0.29in
\vskip -\parskip
\hrule height 1\p@
\vskip 0.09in%
}
% create title (includes both anonymized and non-anonymized versions)
\providecommand{\@maketitle}{}
\renewcommand{\@maketitle}{%
\vbox{%
\hsize\textwidth
\linewidth\hsize
\vskip 0.1in
\@toptitlebar
\centering
{\LARGE\bf \@title\par}
\@bottomtitlebar
\if@submission
\begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}
Anonymous Author(s) \\
Affiliation \\
Address \\
\texttt{email} \\
\end{tabular}%
\else
\def\And{%
\end{tabular}\hfil\linebreak[0]\hfil%
\begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\ignorespaces%
}
\def\AND{%
\end{tabular}\hfil\linebreak[4]\hfil%
\begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\ignorespaces%
}
\begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\@author\end{tabular}%
\fi
\vskip 0.3in \@minus 0.1in
}
}
% add conference notice to bottom of first page
\newcommand{\ftype@noticebox}{8}
\newcommand{\@notice}{%
% give a bit of extra room back to authors on first page
\enlargethispage{2\baselineskip}%
\@float{noticebox}[b]%
\footnotesize\@noticestring%
\end@float%
}
% abstract styling
\renewenvironment{abstract}%
{%
\vskip 0.075in%
\centerline%
{\large\bf Abstract}%
\vspace{0.5ex}%
\begin{quote}%
}
{
\par%
\end{quote}%
\vskip 1ex%
}
% handle tweaks for camera-ready copy vs. submission copy
\if@preprint
\newcommand{\@noticestring}{%
Preprint. Under review.%
}
\else
\if@neuripsfinal
\newcommand{\@noticestring}{%
\@neuripsordinal\/ Conference on Neural Information Processing Systems
(NeurIPS \@neuripsyear).%, \@neuripslocation.%
}
\else
\newcommand{\@noticestring}{%
Submitted to \@neuripsordinal\/ Conference on Neural Information
Processing Systems (NeurIPS \@neuripsyear). Do not distribute.%
}
% hide the acknowledgements
\NewEnviron{hide}{}
\let\ack\hide
\let\endack\endhide
% line numbers for submission
\RequirePackage{lineno}
\linenumbers
% fix incompatibilities between lineno and amsmath, if required, by
% transparently wrapping linenomath environments around amsmath
% environments
\AtBeginDocument{%
\@ifpackageloaded{amsmath}{%
\newcommand*\patchAmsMathEnvironmentForLineno[1]{%
\expandafter\let\csname old#1\expandafter\endcsname\csname #1\endcsname
\expandafter\let\csname oldend#1\expandafter\endcsname\csname end#1\endcsname
\renewenvironment{#1}%
{\linenomath\csname old#1\endcsname}%
{\csname oldend#1\endcsname\endlinenomath}%
}%
\newcommand*\patchBothAmsMathEnvironmentsForLineno[1]{%
\patchAmsMathEnvironmentForLineno{#1}%
\patchAmsMathEnvironmentForLineno{#1*}%
}%
\patchBothAmsMathEnvironmentsForLineno{equation}%
\patchBothAmsMathEnvironmentsForLineno{align}%
\patchBothAmsMathEnvironmentsForLineno{flalign}%
\patchBothAmsMathEnvironmentsForLineno{alignat}%
\patchBothAmsMathEnvironmentsForLineno{gather}%
\patchBothAmsMathEnvironmentsForLineno{multline}%
}
{}
}
\fi
\fi
\endinput
@@ -0,0 +1,17 @@
$-- You can use as many custom partials as you need. Convention is to prefix name with '_'
$-- It can be useful to use such template to split some template parts in smaller pieces, which is easier to reuse.
$-- This '_custom.tex' is used on 'title.tex' as example.
$-- See other existing format in quarto-journals/ organisation.
$-- %%%% TODO %%%%%
$-- Use it if you need to insert content at this specific place of the main Pandoc's template. Otherwise, remove it.
$-- Here we are using it to format the authors part of the template.
$-- %%%%%%%%%%%%%%%
$it.name.literal$%
$if(it.orcid)$~\orcidlink{$it.orcid$}$endif$\\%
$for(it.affiliations/first)$%
$if(it.department)$$it.department$\\$endif$%
$if(it.name)$$it.name$\\$endif$%
$if(it.address)$$it.address$\\$endif$%
$endfor$%
$if(it.email)$\texttt{$it.email$}$endif$
@@ -0,0 +1,20 @@
$-- Implements the frontmatter, title page, and abstract.
$--
$-- %%%% TODO %%%%%
$-- Customize is needed, otherwise remove this partials to use Quarto default one
$-- %%%%%%%%%%%%%%%%
$if(has-frontmatter)$
\frontmatter
$endif$
$if(title)$
$if(beamer)$
\frame{\titlepage}
$else$
\maketitle
$endif$
$if(abstract)$
\begin{abstract}
$abstract$
\end{abstract}
$endif$
$endif$
@@ -0,0 +1,20 @@
$-- Provides image scaling and placement configuration.
$--
$-- %%%% TODO %%%%%
$-- Customize is needed, otherwise remove this partials to use Quarto default one
$-- %%%%%%%%%%%%%%%%
$if(graphics)$
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
$endif$
@@ -0,0 +1,22 @@
$-- Provides configuration of document metadata for writing the title block.
$-- Note that in addition to these templates and partials, Quarto will also make normalized authors and affiliations data available to the template,
$-- making is easy to write custom title blocks against a standard schema.
$--
$-- %%%% TODO %%%%%
$-- Customize is needed, like below for printing the authors. Otherwise remove this partials to use Quarto default one.
$-- %%%%%%%%%%%%%%%%
$if(title)$
\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
$endif$
$if(subtitle)$
\usepackage{etoolbox}
\makeatletter
\providecommand{\subtitle}[1]{% add subtitle to \maketitle
\apptocmd{\@title}{\par {\large #1 \par}}{}{}
}
\makeatother
\subtitle{$subtitle$}
$endif$
\author{${ by-author:_authors.tex()[\and ] }}
\date{$date$}
+375
View File
@@ -0,0 +1,375 @@
% partial rewrite of the LaTeX2e package for submissions to the
% Conference on Neural Information Processing Systems (NeurIPS):
%
% - uses more LaTeX conventions
% - line numbers at submission time replaced with aligned numbers from
% lineno package
% - \nipsfinalcopy replaced with [final] package option
% - automatically loads times package for authors
% - loads natbib automatically; this can be suppressed with the
% [nonatbib] package option
% - adds foot line to first page identifying the conference
% - adds preprint option for submission to e.g. arXiv
% - conference acronym modified
%
% Roman Garnett (garnett@wustl.edu) and the many authors of
% nips15submit_e.sty, including MK and drstrip@sandia
%
% last revision: March 2023
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{neurips_2023}[2023/03/31 NeurIPS 2023 submission/camera-ready style file]
% declare final option, which creates camera-ready copy
\newif\if@neuripsfinal\@neuripsfinalfalse
\DeclareOption{final}{
\@neuripsfinaltrue
}
% declare nonatbib option, which does not load natbib in case of
% package clash (users can pass options to natbib via
% \PassOptionsToPackage)
\newif\if@natbib\@natbibtrue
\DeclareOption{nonatbib}{
\@natbibfalse
}
% declare preprint option, which creates a preprint version ready for
% upload to, e.g., arXiv
\newif\if@preprint\@preprintfalse
\DeclareOption{preprint}{
\@preprinttrue
}
\ProcessOptions\relax
% determine whether this is an anonymized submission
\newif\if@submission\@submissiontrue
\if@neuripsfinal\@submissionfalse\fi
\if@preprint\@submissionfalse\fi
% fonts
\renewcommand{\rmdefault}{ptm}
\renewcommand{\sfdefault}{phv}
% change this every year for notice string at bottom
\newcommand{\@neuripsordinal}{37th}
\newcommand{\@neuripsyear}{2023}
\newcommand{\@neuripslocation}{New Orleans}
% acknowledgments
\usepackage{environ}
\newcommand{\acksection}{\section*{Acknowledgments and Disclosure of Funding}}
\NewEnviron{ack}{%
\acksection
\BODY
}
% load natbib unless told otherwise
\if@natbib
\RequirePackage{natbib}
\fi
% set page geometry
\usepackage[verbose=true,letterpaper]{geometry}
\AtBeginDocument{
\newgeometry{
textheight=9in,
textwidth=5.5in,
top=1in,
headheight=12pt,
headsep=25pt,
footskip=30pt
}
\@ifpackageloaded{fullpage}
{\PackageWarning{neurips_2023}{fullpage package not allowed! Overwriting formatting.}}
{}
}
\widowpenalty=10000
\clubpenalty=10000
\flushbottom
\sloppy
% font sizes with reduced leading
\renewcommand{\normalsize}{%
\@setfontsize\normalsize\@xpt\@xipt
\abovedisplayskip 7\p@ \@plus 2\p@ \@minus 5\p@
\abovedisplayshortskip \z@ \@plus 3\p@
\belowdisplayskip \abovedisplayskip
\belowdisplayshortskip 4\p@ \@plus 3\p@ \@minus 3\p@
}
\normalsize
\renewcommand{\small}{%
\@setfontsize\small\@ixpt\@xpt
\abovedisplayskip 6\p@ \@plus 1.5\p@ \@minus 4\p@
\abovedisplayshortskip \z@ \@plus 2\p@
\belowdisplayskip \abovedisplayskip
\belowdisplayshortskip 3\p@ \@plus 2\p@ \@minus 2\p@
}
\renewcommand{\footnotesize}{\@setfontsize\footnotesize\@ixpt\@xpt}
\renewcommand{\scriptsize}{\@setfontsize\scriptsize\@viipt\@viiipt}
\renewcommand{\tiny}{\@setfontsize\tiny\@vipt\@viipt}
\renewcommand{\large}{\@setfontsize\large\@xiipt{14}}
\renewcommand{\Large}{\@setfontsize\Large\@xivpt{16}}
\renewcommand{\LARGE}{\@setfontsize\LARGE\@xviipt{20}}
\renewcommand{\huge}{\@setfontsize\huge\@xxpt{23}}
\renewcommand{\Huge}{\@setfontsize\Huge\@xxvpt{28}}
% sections with less space
\providecommand{\section}{}
\renewcommand{\section}{%
\@startsection{section}{1}{\z@}%
{-2.0ex \@plus -0.5ex \@minus -0.2ex}%
{ 1.5ex \@plus 0.3ex \@minus 0.2ex}%
{\large\bf\raggedright}%
}
\providecommand{\subsection}{}
\renewcommand{\subsection}{%
\@startsection{subsection}{2}{\z@}%
{-1.8ex \@plus -0.5ex \@minus -0.2ex}%
{ 0.8ex \@plus 0.2ex}%
{\normalsize\bf\raggedright}%
}
\providecommand{\subsubsection}{}
\renewcommand{\subsubsection}{%
\@startsection{subsubsection}{3}{\z@}%
{-1.5ex \@plus -0.5ex \@minus -0.2ex}%
{ 0.5ex \@plus 0.2ex}%
{\normalsize\bf\raggedright}%
}
\providecommand{\paragraph}{}
\renewcommand{\paragraph}{%
\@startsection{paragraph}{4}{\z@}%
{1.5ex \@plus 0.5ex \@minus 0.2ex}%
{-1em}%
{\normalsize\bf}%
}
\providecommand{\subparagraph}{}
\renewcommand{\subparagraph}{%
\@startsection{subparagraph}{5}{\z@}%
{1.5ex \@plus 0.5ex \@minus 0.2ex}%
{-1em}%
{\normalsize\bf}%
}
\providecommand{\subsubsubsection}{}
\renewcommand{\subsubsubsection}{%
\vskip5pt{\noindent\normalsize\rm\raggedright}%
}
% float placement
\renewcommand{\topfraction }{0.85}
\renewcommand{\bottomfraction }{0.4}
\renewcommand{\textfraction }{0.1}
\renewcommand{\floatpagefraction}{0.7}
\newlength{\@neuripsabovecaptionskip}\setlength{\@neuripsabovecaptionskip}{7\p@}
\newlength{\@neuripsbelowcaptionskip}\setlength{\@neuripsbelowcaptionskip}{\z@}
\setlength{\abovecaptionskip}{\@neuripsabovecaptionskip}
\setlength{\belowcaptionskip}{\@neuripsbelowcaptionskip}
% swap above/belowcaptionskip lengths for tables
\renewenvironment{table}
{\setlength{\abovecaptionskip}{\@neuripsbelowcaptionskip}%
\setlength{\belowcaptionskip}{\@neuripsabovecaptionskip}%
\@float{table}}
{\end@float}
% footnote formatting
\setlength{\footnotesep }{6.65\p@}
\setlength{\skip\footins}{9\p@ \@plus 4\p@ \@minus 2\p@}
\renewcommand{\footnoterule}{\kern-3\p@ \hrule width 12pc \kern 2.6\p@}
\setcounter{footnote}{0}
% paragraph formatting
\setlength{\parindent}{\z@}
\setlength{\parskip }{5.5\p@}
% list formatting
\setlength{\topsep }{4\p@ \@plus 1\p@ \@minus 2\p@}
\setlength{\partopsep }{1\p@ \@plus 0.5\p@ \@minus 0.5\p@}
\setlength{\itemsep }{2\p@ \@plus 1\p@ \@minus 0.5\p@}
\setlength{\parsep }{2\p@ \@plus 1\p@ \@minus 0.5\p@}
\setlength{\leftmargin }{3pc}
\setlength{\leftmargini }{\leftmargin}
\setlength{\leftmarginii }{2em}
\setlength{\leftmarginiii}{1.5em}
\setlength{\leftmarginiv }{1.0em}
\setlength{\leftmarginv }{0.5em}
\def\@listi {\leftmargin\leftmargini}
\def\@listii {\leftmargin\leftmarginii
\labelwidth\leftmarginii
\advance\labelwidth-\labelsep
\topsep 2\p@ \@plus 1\p@ \@minus 0.5\p@
\parsep 1\p@ \@plus 0.5\p@ \@minus 0.5\p@
\itemsep \parsep}
\def\@listiii{\leftmargin\leftmarginiii
\labelwidth\leftmarginiii
\advance\labelwidth-\labelsep
\topsep 1\p@ \@plus 0.5\p@ \@minus 0.5\p@
\parsep \z@
\partopsep 0.5\p@ \@plus 0\p@ \@minus 0.5\p@
\itemsep \topsep}
\def\@listiv {\leftmargin\leftmarginiv
\labelwidth\leftmarginiv
\advance\labelwidth-\labelsep}
\def\@listv {\leftmargin\leftmarginv
\labelwidth\leftmarginv
\advance\labelwidth-\labelsep}
\def\@listvi {\leftmargin\leftmarginvi
\labelwidth\leftmarginvi
\advance\labelwidth-\labelsep}
% create title
\providecommand{\maketitle}{}
\renewcommand{\maketitle}{%
\par
\begingroup
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
% for perfect author name centering
\renewcommand{\@makefnmark}{\hbox to \z@{$^{\@thefnmark}$\hss}}
% The footnote-mark was overlapping the footnote-text,
% added the following to fix this problem (MK)
\long\def\@makefntext##1{%
\parindent 1em\noindent
\hbox to 1.8em{\hss $\m@th ^{\@thefnmark}$}##1
}
\thispagestyle{empty}
\@maketitle
\@thanks
\@notice
\endgroup
\let\maketitle\relax
\let\thanks\relax
}
% rules for title box at top of first page
\newcommand{\@toptitlebar}{
\hrule height 4\p@
\vskip 0.25in
\vskip -\parskip%
}
\newcommand{\@bottomtitlebar}{
\vskip 0.29in
\vskip -\parskip
\hrule height 1\p@
\vskip 0.09in%
}
% create title (includes both anonymized and non-anonymized versions)
\providecommand{\@maketitle}{}
\renewcommand{\@maketitle}{%
\vbox{%
\hsize\textwidth
\linewidth\hsize
\vskip 0.1in
\@toptitlebar
\centering
{\LARGE\bf \@title\par}
\@bottomtitlebar
\if@submission
\begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}
Anonymous Author(s) \\
Affiliation \\
Address \\
\texttt{email} \\
\end{tabular}%
\else
\def\And{%
\end{tabular}\hfil\linebreak[0]\hfil%
\begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\ignorespaces%
}
\def\AND{%
\end{tabular}\hfil\linebreak[4]\hfil%
\begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\ignorespaces%
}
\begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\@author\end{tabular}%
\fi
\vskip 0.3in \@minus 0.1in
}
}
% add conference notice to bottom of first page
\newcommand{\ftype@noticebox}{8}
\newcommand{\@notice}{%
% give a bit of extra room back to authors on first page
\enlargethispage{2\baselineskip}%
\@float{noticebox}[b]%
\footnotesize\@noticestring%
\end@float%
}
% abstract styling
\renewenvironment{abstract}%
{%
\vskip 0.075in%
\centerline%
{\large\bf Abstract}%
\vspace{0.5ex}%
\begin{quote}%
}
{
\par%
\end{quote}%
\vskip 1ex%
}
% handle tweaks for camera-ready copy vs. submission copy
\if@preprint
\newcommand{\@noticestring}{%
Preprint. Under review.%
}
\else
\if@neuripsfinal
\newcommand{\@noticestring}{%
\@neuripsordinal\/ Conference on Neural Information Processing Systems
(NeurIPS \@neuripsyear).%, \@neuripslocation.%
}
\else
\newcommand{\@noticestring}{%
Submitted to \@neuripsordinal\/ Conference on Neural Information
Processing Systems (NeurIPS \@neuripsyear). Do not distribute.%
}
% hide the acknowledgements
\NewEnviron{hide}{}
\let\ack\hide
\let\endack\endhide
% line numbers for submission
\RequirePackage{lineno}
\linenumbers
% fix incompatibilities between lineno and amsmath, if required, by
% transparently wrapping linenomath environments around amsmath
% environments
\AtBeginDocument{%
\@ifpackageloaded{amsmath}{%
\newcommand*\patchAmsMathEnvironmentForLineno[1]{%
\expandafter\let\csname old#1\expandafter\endcsname\csname #1\endcsname
\expandafter\let\csname oldend#1\expandafter\endcsname\csname end#1\endcsname
\renewenvironment{#1}%
{\linenomath\csname old#1\endcsname}%
{\csname oldend#1\endcsname\endlinenomath}%
}%
\newcommand*\patchBothAmsMathEnvironmentsForLineno[1]{%
\patchAmsMathEnvironmentForLineno{#1}%
\patchAmsMathEnvironmentForLineno{#1*}%
}%
\patchBothAmsMathEnvironmentsForLineno{equation}%
\patchBothAmsMathEnvironmentsForLineno{align}%
\patchBothAmsMathEnvironmentsForLineno{flalign}%
\patchBothAmsMathEnvironmentsForLineno{alignat}%
\patchBothAmsMathEnvironmentsForLineno{gather}%
\patchBothAmsMathEnvironmentsForLineno{multline}%
}
{}
}
\fi
\fi
\endinput
+132
View File
@@ -0,0 +1,132 @@
---
title: "Steer then heal: distilling an activation steering vector into LoRA weights without the incoherence"
format:
neurips-pdf:
keep-tex: true
neurips-html: default
author:
- name: wassname
email: claude@wassname.org
abstract: |
<!-- TODO: abstract. Draft once U2/U3 gates resolve. Structure (Heilmeier + Nature summary):
(1) field: activation steering moves a trait at inference but leaks incoherence;
(2) problem: distilling the steered teacher into weights bakes the incoherence in too;
(3) what we do: distil the vector into a LoRA and heal the leaked incoherence with a
KL-to-base barrier, looped over rounds, anchored to the round-0 original;
(4) headline metric: coh_cost = |dCoh|/|dAuth|, coherence cost per nat of trait;
(5) finding so far (provisional): in the coherent steering regime the trait is near-free
(coherence pins ~1.0), and the round-0-anchored barrier STALLS the loop. Numbers TODO. -->
keywords: [activation steering, steering vectors, LoRA, knowledge distillation, coherence, moral foundations]
reference-section-title: References
bibliography: references.bib
---
## Introduction {#sec-intro}
Activation steering moves a model toward a trait by adding a direction to its
residual stream at inference time [@turner2023activation; @panickssery2023caa; @zou2023representation].
The catch is that the same push that shifts the trait also degrades coherence,
and the effect lives only as long as the hook is attached. @blank2026subliminal
show that training a student on a steered teacher's completions distils that
direction into the weights. We ask the follow-up question they leave open: when
you bake the vector in, you also bake in the incoherence it leaks, so can a
regulariser anchored to the original model heal that incoherence while keeping
the trait?
The trait here is "do not defer to authority", operationalised as care over
authority on the tinymfv moral-foundations forced-choice eval (the Authority and
Care/Harm foundations of @graham2009liberals; @graham2013mft). We report the
coherence cost per nat of trait, $\text{coh\_cost} = |\Delta\text{Coh}| / |\Delta\text{Auth}|$.
<!-- TODO: contributions list (paper-writing: end intro with bullet contributions).
Draft once results land. Candidate claims, all provisional:
- in the COHERENT steering regime the trait is near-free (coherence pinned ~1.0);
- the round-0-anchored barrier STALLS the loop (heal walks the trait back toward base);
- which regulariser (nll / kl_fwd / kl_rev / wd) wins, if any. -->
## Related work {#sec-related}
We build directly on @blank2026subliminal: same steering-vector-distillation
backbone, but we add an explicit coherence regulariser, measure coherence with
tinymfv, and iterate over rounds. @turner2023activation and @panickssery2023caa
extract and apply steering vectors but do not distil them into weights.
@fierro2025weight also edit weights toward a trait, but they take the direction
from the difference of two fine-tuned adapters rather than from an activation
steering vector, and they neither measure nor heal coherence. The healing
adapter is LoRA [@hu2021lora]; the gated-history accumulator that folds finished
rounds while keeping the base pristine is in the PiSSA / steering-lite lineage
[@meng2024pissa].
<!-- TODO: one paragraph sharpening "how we differ" per cited work (see spec.md). -->
## Method {#sec-method}
The pipeline is steer, distil, heal, loop, anchored to the round-0 original
throughout.
*Steer.* The teacher vector is the mean residual-stream shift from a trait
system prompt to a neutral one, read at the assistant tag over a set of diverse
contexts, following @blank2026subliminal. We dose it by sweeping the coefficient
over a small set of scales and keeping the completions that pass a coherence and
trait filter, rather than calibrating a single coefficient.
*Distil and heal.* We generate steered completions, filter the incoherent and
trait-narrating ones, then train a LoRA on the survivors. One objective, one
constraint: SFT cross-entropy plus a barrier $\lambda \cdot \text{relu}(D - \tau)$
that switches off while the divergence $D$ to the original model is already
within the coherence region. $D$ is the variable under test: `nll` (no barrier),
`kl_fwd`, `kl_rev`, and adapter-only weight decay `wd`.
*Loop.* Each finished round folds into a frozen accumulator with its own gate,
so the base stays recoverable (gates off) as the KL reference and base eval,
while only the current round trains.
<!-- TODO: barrier figure or the BakedLoRA forward as a numbered equation; pseudopy block (see spec.md). -->
## Experimental setup {#sec-setup}
<!-- TODO: model (gemma-3-4b-it / Qwen3-4B), seeds, prompt set D, layer band,
n kept completions, epochs, LoRA rank, alpha sweep set, barrier tau/lambda.
Fill from config.py defaults at write time. -->
The headline trait metric is `auth_nats`, the log of tinymfv's marginal blame
mass on Authority (lower means more of the trait). Coherence is the tinymfv
`p_ans_any` answer mass. Surgicality is whether Authority moves while Care does
not.
## Results {#sec-results}
<!-- TODO: results. Reference the figures the pipeline already emits:
out/{ts}_{slug}/trajectory.png -- steer (red) -> heal (green) trait-coherence
pareto over rounds, plus the per-round auth_nats and coherence panels;
out/{ts}_{slug}/map.html -- the Care-vs-Authority interactive map, one node per round.
Headline table: coh_cost per arm. Do NOT fill numbers until a clean run lands. -->
::: {#fig-trajectory}
<!-- TODO: include out/{ts}_{slug}/trajectory.png once a representative run is chosen.
![](trajectory.png) -->
Steer (red) to heal (green) over rounds: trait (`auth_nats`, down is more trait)
against coherence (held near 1.0), with the trait-coherence pareto map. *Placeholder.*
:::
## Discussion {#sec-discussion}
<!-- TODO. Provisional read to develop once numbers land: in the coherent steering
regime the trait is near-free (coherence pinned ~1.0 across steer and heal), so
there is little incoherence left to heal. The round-0-anchored barrier then STALLS
the loop: anchored to base, heal walks the trait back toward base rather than
letting it accumulate across rounds. Whether kl_rev's mode-seeking suppression
helps here is the open question. -->
## Limitations {#sec-limitations}
<!-- TODO. Candidates: single model and single trait; auth_nats is a marginal
log-mass readout with a Jensen gap vs steering-lite's per-row delta-logit, so nat
magnitudes are provisional; coherence canary is necessary but not sufficient;
the round-0 anchor that resists drift is also what stalls accumulation. -->
## Conclusion {#sec-conclusion}
<!-- TODO. Write last. State what the steer-distil-heal-loop does and does not buy
over plain SFT at matched coherence, in one or two sentences, no overclaim. -->
+111
View File
@@ -0,0 +1,111 @@
% references.bib for steer_heal writeup.
% All entries verified against arxiv abstract pages or publisher records (2026-06).
% Provenance noted per entry. Anything I could not confirm is marked "% TODO verify".
% --- The paper we build on (steering-vector distillation backbone) ---
% Verified: arxiv.org/abs/2606.00995 title + author list.
@misc{blank2026subliminal,
title = {Subliminal Learning Is Steering Vector Distillation},
author = {Blank, Camila and Bhatia, Agam and Rajamanoharan, Senthooran and Conmy, Arthur and Nanda, Neel},
year = {2026},
eprint = {2606.00995},
archiveprefix = {arXiv},
primaryclass = {cs.LG},
url = {https://arxiv.org/abs/2606.00995}
}
% --- Activation steering / steering vectors ---
% Verified: arxiv.org/abs/2308.10248 (ActAdd).
@misc{turner2023activation,
title = {Steering Language Models With Activation Engineering},
author = {Turner, Alexander Matt and Thiergart, Lisa and Leech, Gavin and Udell, David and Vazquez, Juan J. and Mini, Ulisse and MacDiarmid, Monte},
year = {2023},
eprint = {2308.10248},
archiveprefix = {arXiv},
primaryclass = {cs.CL},
url = {https://arxiv.org/abs/2308.10248}
}
% Verified: arxiv.org/abs/2312.06681 (CAA). First author now listed as Nina Panickssery (formerly Rimsky).
@misc{panickssery2023caa,
title = {Steering Llama 2 via Contrastive Activation Addition},
author = {Panickssery, Nina and Gabrieli, Nick and Schulz, Julian and Tong, Meg and Hubinger, Evan and Turner, Alexander Matt},
year = {2023},
eprint = {2312.06681},
archiveprefix = {arXiv},
primaryclass = {cs.CL},
url = {https://arxiv.org/abs/2312.06681}
}
% --- Representation engineering ---
% Verified: arxiv.org/abs/2310.01405.
@misc{zou2023representation,
title = {Representation Engineering: A Top-Down Approach to AI Transparency},
author = {Zou, Andy and Phan, Long and Chen, Sarah and Campbell, James and Guo, Phillip and Ren, Richard and Pan, Alexander and Yin, Xuwang and Mazeika, Mantas and Dombrowski, Ann-Kathrin and Goel, Shashwat and Li, Nathaniel and Byun, Michael J. and Wang, Zifan and Mallen, Alex and Basart, Steven and Koyejo, Sanmi and Song, Dawn and Fredrikson, Matt and Kolter, J. Zico and Hendrycks, Dan},
year = {2023},
eprint = {2310.01405},
archiveprefix = {arXiv},
primaryclass = {cs.LG},
url = {https://arxiv.org/abs/2310.01405}
}
% --- LoRA + PiSSA lineage ---
% Verified: arxiv.org/abs/2106.09685.
@misc{hu2021lora,
title = {LoRA: Low-Rank Adaptation of Large Language Models},
author = {Hu, Edward J. and Shen, Yelong and Wallis, Phillip and Allen-Zhu, Zeyuan and Li, Yuanzhi and Wang, Shean and Wang, Lu and Chen, Weizhu},
year = {2021},
eprint = {2106.09685},
archiveprefix = {arXiv},
primaryclass = {cs.CL},
url = {https://arxiv.org/abs/2106.09685}
}
% Verified: arxiv.org/abs/2404.02948 (PiSSA).
@misc{meng2024pissa,
title = {PiSSA: Principal Singular Values and Singular Vectors Adaptation of Large Language Models},
author = {Meng, Fanxu and Wang, Zhaohui and Zhang, Muhan},
year = {2024},
eprint = {2404.02948},
archiveprefix = {arXiv},
primaryclass = {cs.LG},
url = {https://arxiv.org/abs/2404.02948}
}
% --- Weight steering (positioning / related) ---
% Verified: arxiv.org/abs/2511.05408.
@misc{fierro2025weight,
title = {Steering Language Models with Weight Arithmetic},
author = {Fierro, Constanza and Roger, Fabien},
year = {2025},
eprint = {2511.05408},
archiveprefix = {arXiv},
primaryclass = {cs.LG},
url = {https://arxiv.org/abs/2511.05408}
}
% --- Moral foundations theory (the eval axis) ---
% Verified: Journal of Personality and Social Psychology 96(5), 1029-1046.
@article{graham2009liberals,
title = {Liberals and conservatives rely on different sets of moral foundations},
author = {Graham, Jesse and Haidt, Jonathan and Nosek, Brian A.},
journal = {Journal of Personality and Social Psychology},
volume = {96},
number = {5},
pages = {1029--1046},
year = {2009},
publisher = {American Psychological Association},
doi = {10.1037/a0015141}
}
% Verified: Advances in Experimental Social Psychology 47, 55-130.
@incollection{graham2013mft,
title = {Moral Foundations Theory: The Pragmatic Validity of Moral Pluralism},
author = {Graham, Jesse and Haidt, Jonathan and Koleva, Sena and Motyl, Matt and Iyer, Ravi and Wojcik, Sean P. and Ditto, Peter H.},
booktitle = {Advances in Experimental Social Psychology},
volume = {47},
pages = {55--130},
year = {2013},
publisher = {Academic Press},
doi = {10.1016/B978-0-12-407236-7.00002-4}
}