litetune 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- litetune-0.1.0/.github/workflows/ci.yml +50 -0
- litetune-0.1.0/.github/workflows/publish.yml +52 -0
- litetune-0.1.0/.gitignore +14 -0
- litetune-0.1.0/LICENSE +201 -0
- litetune-0.1.0/MEASUREMENTS.md +141 -0
- litetune-0.1.0/PKG-INFO +262 -0
- litetune-0.1.0/README.md +238 -0
- litetune-0.1.0/pyproject.toml +108 -0
- litetune-0.1.0/src/litetune/__init__.py +29 -0
- litetune-0.1.0/src/litetune/_version.py +13 -0
- litetune-0.1.0/src/litetune/bundle.py +966 -0
- litetune-0.1.0/src/litetune/checks.py +145 -0
- litetune-0.1.0/src/litetune/cli.py +1295 -0
- litetune-0.1.0/src/litetune/envs.py +427 -0
- litetune-0.1.0/src/litetune/evaluate.py +1030 -0
- litetune-0.1.0/src/litetune/events.py +114 -0
- litetune-0.1.0/src/litetune/exits.py +112 -0
- litetune-0.1.0/src/litetune/export.py +1051 -0
- litetune-0.1.0/src/litetune/liveness.py +372 -0
- litetune-0.1.0/src/litetune/manifest.py +362 -0
- litetune-0.1.0/src/litetune/metrics.py +391 -0
- litetune-0.1.0/src/litetune/models.py +810 -0
- litetune-0.1.0/src/litetune/prepare.py +1107 -0
- litetune-0.1.0/src/litetune/py.typed +0 -0
- litetune-0.1.0/src/litetune/runner.py +777 -0
- litetune-0.1.0/src/litetune/spec.py +887 -0
- litetune-0.1.0/src/litetune/storage.py +254 -0
- litetune-0.1.0/src/litetune/tune.py +1197 -0
- litetune-0.1.0/src/litetune/verify.py +753 -0
- litetune-0.1.0/tests/conftest.py +104 -0
- litetune-0.1.0/tests/stage_fakes.py +143 -0
- litetune-0.1.0/tests/test_bundle.py +901 -0
- litetune-0.1.0/tests/test_checks.py +52 -0
- litetune-0.1.0/tests/test_cli.py +1324 -0
- litetune-0.1.0/tests/test_envs.py +262 -0
- litetune-0.1.0/tests/test_evaluate.py +343 -0
- litetune-0.1.0/tests/test_exits.py +164 -0
- litetune-0.1.0/tests/test_export.py +674 -0
- litetune-0.1.0/tests/test_liveness.py +156 -0
- litetune-0.1.0/tests/test_manifest.py +251 -0
- litetune-0.1.0/tests/test_metrics.py +228 -0
- litetune-0.1.0/tests/test_models.py +519 -0
- litetune-0.1.0/tests/test_prepare.py +605 -0
- litetune-0.1.0/tests/test_prompt_mode.py +265 -0
- litetune-0.1.0/tests/test_runner.py +525 -0
- litetune-0.1.0/tests/test_spec.py +338 -0
- litetune-0.1.0/tests/test_storage.py +127 -0
- litetune-0.1.0/tests/test_tune.py +1151 -0
- litetune-0.1.0/tests/test_verify.py +450 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
check:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
# The floor and the current release. The floor is declared in
|
|
15
|
+
# pyproject.toml and was previously untested, which made it a claim
|
|
16
|
+
# rather than a fact.
|
|
17
|
+
python-version: ["3.10", "3.13"]
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
- uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
- run: pip install -e ".[dev]"
|
|
24
|
+
- run: ruff check src tests
|
|
25
|
+
- run: ruff format --check src tests
|
|
26
|
+
- run: mypy
|
|
27
|
+
# The whole suite runs on fakes: no subprocess, no network, no GPU.
|
|
28
|
+
- run: pytest -q
|
|
29
|
+
|
|
30
|
+
# An editable install is not the artifact anyone receives. `src/` layout plus
|
|
31
|
+
# a dynamic hatch version plus `license-files` is exactly the surface where
|
|
32
|
+
# `pip install -e .` passes and a wheel does not.
|
|
33
|
+
wheel:
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
|
+
- uses: actions/setup-python@v5
|
|
38
|
+
with:
|
|
39
|
+
python-version: "3.10"
|
|
40
|
+
- run: pip install build twine
|
|
41
|
+
- run: python -m build
|
|
42
|
+
- run: twine check dist/*
|
|
43
|
+
- name: install the wheel into a clean environment
|
|
44
|
+
run: |
|
|
45
|
+
python -m venv /tmp/fresh
|
|
46
|
+
/tmp/fresh/bin/pip install dist/*.whl
|
|
47
|
+
/tmp/fresh/bin/litetune --help
|
|
48
|
+
/tmp/fresh/bin/python -c "import litetune, pathlib; \
|
|
49
|
+
assert litetune.__version__, 'no version'; \
|
|
50
|
+
assert (pathlib.Path(litetune.__file__).parent / 'py.typed').is_file(), 'no py.typed'"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Publishes to PyPI when a GitHub Release is published.
|
|
2
|
+
#
|
|
3
|
+
# No API token anywhere. PyPI trusts this exact workflow in this exact
|
|
4
|
+
# repository through OIDC, so there is no secret to leak, rotate, or paste into
|
|
5
|
+
# a chat window. `id-token: write` is what mints the short-lived credential;
|
|
6
|
+
# without it the publish step has nothing to authenticate with.
|
|
7
|
+
name: publish
|
|
8
|
+
|
|
9
|
+
on:
|
|
10
|
+
release:
|
|
11
|
+
types: [published]
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
pypi:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
environment: pypi
|
|
17
|
+
permissions:
|
|
18
|
+
# The whole authentication story. Everything else stays read-only.
|
|
19
|
+
id-token: write
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.12"
|
|
26
|
+
|
|
27
|
+
# Imported, not scraped. A regex for the first double-quoted string in
|
|
28
|
+
# the file matched the module docstring -- which contains `"never raises"`
|
|
29
|
+
# -- and reported that as the package version. The guard failed safe, by
|
|
30
|
+
# refusing to publish, but for the wrong reason. `_version.py` is a leaf
|
|
31
|
+
# module with no imports of its own, so importing it costs nothing.
|
|
32
|
+
#
|
|
33
|
+
# The tag is the version. A release built from a tree whose
|
|
34
|
+
# `_version.py` says something else would publish an artifact whose
|
|
35
|
+
# recorded version does not lead back to the code that made it -- and
|
|
36
|
+
# `manifest.py` writes that version into every artifact litetune
|
|
37
|
+
# produces, so the mismatch would propagate to the user's bundles.
|
|
38
|
+
- name: The tag and the package must agree
|
|
39
|
+
run: |
|
|
40
|
+
set -o pipefail
|
|
41
|
+
tag="${GITHUB_REF_NAME#v}"
|
|
42
|
+
pkg=$(PYTHONPATH=src python -c "from litetune._version import __version__; print(__version__)")
|
|
43
|
+
echo "tag=$tag package=$pkg"
|
|
44
|
+
test "$tag" = "$pkg" || { echo "::error::tag $tag does not match _version.py $pkg"; exit 1; }
|
|
45
|
+
|
|
46
|
+
- name: Build
|
|
47
|
+
run: |
|
|
48
|
+
python -m pip install --upgrade build
|
|
49
|
+
python -m build
|
|
50
|
+
|
|
51
|
+
- name: Publish
|
|
52
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
litetune-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Sasha Denisov
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# What was measured, and what it established
|
|
2
|
+
|
|
3
|
+
Numbers for `litetune`. Everything here is `functiongemma-270m-it` LoRA-tuned on
|
|
4
|
+
`google/mobile-actions`, scored on 640 held-out single-call examples; exact match
|
|
5
|
+
means the tool name **and** every argument value.
|
|
6
|
+
|
|
7
|
+
This file exists so the README can be a usage guide. It is the longer story:
|
|
8
|
+
what reproduced, what did not, and which published claims were withdrawn.
|
|
9
|
+
|
|
10
|
+
## The headline numbers
|
|
11
|
+
|
|
12
|
+
| | float | `dynamic_wi8_afp32` | `weight_only_wi8_afp32` |
|
|
13
|
+
|---|---|---|---|
|
|
14
|
+
| Base model | 0.7266 ±0.0345 | — | — |
|
|
15
|
+
| Fine-tuned | **0.9172** ±0.0214 | 0.9016 ±0.0231 | 0.9047 ±0.0228 |
|
|
16
|
+
| Cost of conversion | — | +0.0156 ±0.0162 *(unresolved)* | **+0.0125** ±0.0123 |
|
|
17
|
+
|
|
18
|
+
Fine-tuning gained **+0.1906 ±0.0357**, measured paired: only the examples where
|
|
19
|
+
the two models disagree carry signal, and 136 of 640 did.
|
|
20
|
+
|
|
21
|
+
Pairing is not a refinement for its own sake. `weight_only_wi8_afp32` costs
|
|
22
|
+
**+0.0125**, and the estimate is the same either way — what changes is what can
|
|
23
|
+
be said about it. Paired, the interval is **±0.0123**, just clear of zero, so
|
|
24
|
+
the effect is resolved. Unpaired it is **±0.0312**, which straddles zero and
|
|
25
|
+
would be reported as noise. Both sides answered the same 640 prompts; treating
|
|
26
|
+
them as independent samples throws away exactly the information that settles the
|
|
27
|
+
question.
|
|
28
|
+
|
|
29
|
+
### The base figure is measured under a rendering the base did not learn
|
|
30
|
+
|
|
31
|
+
**Read the base column with this in mind.** The declaration properties in every
|
|
32
|
+
prompt above are rendered in *declaration order*, which is what the reference
|
|
33
|
+
consumer (`flutter_gemma`) emits. The jinja template inside the `.litertlm` we
|
|
34
|
+
ship renders them with `dictsort` — measured, eight occurrences, including on
|
|
35
|
+
declaration properties. On this dataset the two orders disagree for **100% of
|
|
36
|
+
rows**, so one bundle presents two different prompts depending on which path a
|
|
37
|
+
consumer takes.
|
|
38
|
+
|
|
39
|
+
Which order the weights prefer was argued rather than measured until it was
|
|
40
|
+
measured. Same greedy decode, same parser, one variable:
|
|
41
|
+
|
|
42
|
+
| | n | declaration order | `dictsort` | paired difference | discordant pairs |
|
|
43
|
+
|---|---|---|---|---|---|
|
|
44
|
+
| Base, held-out | 640 | 0.7266 | **0.7625** | −0.0359 ±0.0219 | 51 |
|
|
45
|
+
| Base, disjoint sample | 1280 | 0.7602 | **0.7789** | −0.0187 ±0.0099 | 42 |
|
|
46
|
+
| **Fine-tuned**, held-out | 640 | 0.9109 | 0.9141 | −0.0031 ±0.0087 *(unresolved)* | **8** |
|
|
47
|
+
|
|
48
|
+
**The base cares and the fine-tuned model does not.** For the base both runs
|
|
49
|
+
resolve, both favour `dictsort`, the intervals overlap at [−0.0286, −0.0140],
|
|
50
|
+
and the discordant pairs run three to one. After fine-tuning the same comparison
|
|
51
|
+
collapses: 51 discordant pairs become 8, and the difference is 0.0031 against an
|
|
52
|
+
interval of ±0.0087 — unresolved not for want of data but for want of an effect.
|
|
53
|
+
|
|
54
|
+
The mechanism is visible in the failures. It is not a parsing artifact — argument
|
|
55
|
+
dicts compare without regard to key order, so a reordered call scores the same.
|
|
56
|
+
What moves is *which argument the model extracts*: given a declaration in the
|
|
57
|
+
order it did not learn, the base returns `email` where the target wanted
|
|
58
|
+
`phone_number`. It had learned "the Nth property is X". Fine-tuning teaches it to
|
|
59
|
+
read the name instead, and the position stops mattering.
|
|
60
|
+
|
|
61
|
+
Two consequences for the headline table:
|
|
62
|
+
|
|
63
|
+
- **The base column is understated**, because it was measured in declaration
|
|
64
|
+
order. Under the order the weights prefer it is 0.7625.
|
|
65
|
+
- **The fine-tuning gain depends on which base you compare against**, and both
|
|
66
|
+
are now measured rather than inferred: **+0.1843** entirely in declaration
|
|
67
|
+
order, **+0.1516** entirely in `dictsort`. The published +0.19 sits above both
|
|
68
|
+
because it pairs a tuned model measured at its best against a base measured at
|
|
69
|
+
its worst.
|
|
70
|
+
|
|
71
|
+
`contract.json` records which convention a bundle was built under, so a consumer
|
|
72
|
+
is not guessing. On the evidence above that matters for a base or lightly-tuned
|
|
73
|
+
checkpoint and is close to free for a fully fine-tuned one — but "close to free"
|
|
74
|
+
is a measurement on one model and one dataset, not a property of the method.
|
|
75
|
+
|
|
76
|
+
### What three runs of the same thing disagree about
|
|
77
|
+
|
|
78
|
+
The same recipe sweep, run three times on the same data with the same code. B
|
|
79
|
+
and C are the identical shipping configuration; A differs only in the bundle's
|
|
80
|
+
declared model type, which the text-parsing measurement cannot observe:
|
|
81
|
+
|
|
82
|
+
| | run A | run B | run C |
|
|
83
|
+
|---|---|---|---|
|
|
84
|
+
| Base, float | 0.7266 | 0.7266 | 0.7266 |
|
|
85
|
+
| Fine-tuned, float | 0.9094 | 0.9172 | 0.9062 |
|
|
86
|
+
| `dynamic_wi8_afp32` | 0.8906 — **resolved** | 0.9016 — *unresolved* | 0.8969 — *unresolved* |
|
|
87
|
+
| `weight_only_wi8_afp32` | 0.9141 — *unresolved* | 0.9047 — **resolved** | 0.9000 — *unresolved* |
|
|
88
|
+
| Gap between recipes | 0.0235 | 0.0031 | 0.0031 |
|
|
89
|
+
|
|
90
|
+
**The recipes swap places, and which cost resolves moves with them.** An earlier
|
|
91
|
+
draft of this file read "the two recipes differ by 0.0234 on the same weights at
|
|
92
|
+
the same bit width" and drew a conclusion from it. Two further runs put that gap
|
|
93
|
+
at 0.0031 and 0.0031. The gap was noise, and a single run had presented it as a
|
|
94
|
+
finding.
|
|
95
|
+
|
|
96
|
+
Across all three, the conversion cost resolves in **2 of 6** recipe-runs -- and
|
|
97
|
+
B and C, which are the same configuration end to end, still disagree about
|
|
98
|
+
`weight_only`.
|
|
99
|
+
|
|
100
|
+
So what is actually established is narrower than one run suggests, and worth
|
|
101
|
+
separating:
|
|
102
|
+
|
|
103
|
+
- **The base figure is 0.7266**, identical to four decimal places in all three,
|
|
104
|
+
and reproduced across a rebuilt container image, a `transformers` major version
|
|
105
|
+
change, new batching code and a rewritten parser.
|
|
106
|
+
- **Fine-tuning gains about +0.18**, resolved in every run, on 132-136 discordant
|
|
107
|
+
pairs. The spread across runs is 0.0109 — an order below the effect.
|
|
108
|
+
- **Conversion costs something small** — 0.0063 to 0.0187 across runs — and
|
|
109
|
+
whether 640 examples *resolve* it is close to a coin flip. At this effect size
|
|
110
|
+
the method is at its limit, and one run's verdict should not be quoted as the
|
|
111
|
+
answer.
|
|
112
|
+
|
|
113
|
+
That last line is the tool working, not failing. A single accuracy number would
|
|
114
|
+
have shown none of this; three points and a paired interval show exactly where
|
|
115
|
+
the evidence stops. If you need to separate two recipes this close, you need
|
|
116
|
+
more held-out examples than 640 — and `verify` will keep saying "unresolved"
|
|
117
|
+
until you have them, rather than picking a winner.
|
|
118
|
+
|
|
119
|
+
Nothing in the file size, the exit code, or the logs separates those two
|
|
120
|
+
artifacts: they are 455,759,152 and 455,939,600 bytes, 0.04% apart. Running both
|
|
121
|
+
against held-out data is the only thing that does.
|
|
122
|
+
|
|
123
|
+
Three points rather than two, because only the differences mean anything. A
|
|
124
|
+
single accuracy figure for a converted model cannot distinguish a good
|
|
125
|
+
conversion of a bad model from a bad conversion of a good one.
|
|
126
|
+
|
|
127
|
+
**One `verify` run measures two of them, not three.** It compares the converted
|
|
128
|
+
model against one reference, and which reference you name decides which
|
|
129
|
+
difference you get:
|
|
130
|
+
|
|
131
|
+
| `--reference-role` | reference is | you get | you do not get |
|
|
132
|
+
|---|---|---|---|
|
|
133
|
+
| `float_twin` (default) | the checkpoint the artifact was converted from | conversion cost | training gain |
|
|
134
|
+
| `untuned_base` | the model before you trained it | *neither* — the difference confounds them | both |
|
|
135
|
+
|
|
136
|
+
The headline table therefore comes from two runs, not one. `verify` reports the
|
|
137
|
+
missing figure as `unavailable` with the reason, rather than deriving it from
|
|
138
|
+
the two points it has — deriving it is the mistake the third point exists to
|
|
139
|
+
prevent. Composing the three into a single command is the first thing on the
|
|
140
|
+
list after this alpha; the README's *Limitations* records what is not wired.
|
|
141
|
+
|