<s>
Limited-memory	B-Algorithm
BFGS	I-Algorithm
(	O
L-BFGS	B-Algorithm
or	O
LM-BFGS	B-Algorithm
)	O
is	O
an	O
optimization	O
algorithm	O
in	O
the	O
family	O
of	O
quasi-Newton	B-Algorithm
methods	I-Algorithm
that	O
approximates	O
the	O
Broyden	B-Algorithm
–	I-Algorithm
Fletcher	I-Algorithm
–	I-Algorithm
Goldfarb	I-Algorithm
–	I-Algorithm
Shanno	I-Algorithm
algorithm	I-Algorithm
(	O
BFGS	B-Algorithm
)	O
using	O
a	O
limited	O
amount	O
of	O
computer	B-General_Concept
memory	I-General_Concept
.	O
</s>
<s>
Like	O
the	O
original	O
BFGS	B-Algorithm
,	O
L-BFGS	B-Algorithm
uses	O
an	O
estimate	O
of	O
the	O
inverse	O
Hessian	O
matrix	O
to	O
steer	O
its	O
search	O
through	O
variable	O
space	O
,	O
but	O
where	O
BFGS	B-Algorithm
stores	O
a	O
dense	O
approximation	O
to	O
the	O
inverse	O
Hessian	O
(	O
n	O
being	O
the	O
number	O
of	O
variables	O
in	O
the	O
problem	O
)	O
,	O
L-BFGS	B-Algorithm
stores	O
only	O
a	O
few	O
vectors	O
that	O
represent	O
the	O
approximation	O
implicitly	O
.	O
</s>
<s>
Due	O
to	O
its	O
resulting	O
linear	O
memory	O
requirement	O
,	O
the	O
L-BFGS	B-Algorithm
method	O
is	O
particularly	O
well	O
suited	O
for	O
optimization	O
problems	O
with	O
many	O
variables	O
.	O
</s>
<s>
Instead	O
of	O
the	O
inverse	O
Hessian	O
Hk	O
,	O
L-BFGS	B-Algorithm
maintains	O
a	O
history	O
of	O
the	O
past	O
m	O
updates	O
of	O
the	O
position	O
x	O
and	O
gradient	O
∇	O
f(x )	O
,	O
where	O
generally	O
the	O
history	O
size	O
m	O
can	O
be	O
small	O
(	O
often	O
)	O
.	O
</s>
<s>
L-BFGS	B-Algorithm
shares	O
many	O
features	O
with	O
other	O
quasi-Newton	B-Algorithm
algorithms	I-Algorithm
,	O
but	O
is	O
very	O
different	O
in	O
how	O
the	O
matrix-vector	O
multiplication	O
is	O
carried	O
out	O
,	O
where	O
is	O
the	O
approximate	O
Newton	O
's	O
direction	O
,	O
is	O
the	O
current	O
gradient	O
,	O
and	O
is	O
the	O
inverse	O
of	O
the	O
Hessian	O
matrix	O
.	O
</s>
<s>
A	O
Wolfe	O
line	O
search	O
is	O
used	O
to	O
ensure	O
that	O
the	O
curvature	O
condition	O
is	O
satisfied	O
and	O
the	O
BFGS	B-Algorithm
updating	O
is	O
stable	O
.	O
</s>
<s>
Note	O
that	O
some	O
software	O
implementations	O
use	O
an	O
Armijo	O
backtracking	B-Algorithm
line	I-Algorithm
search	I-Algorithm
,	O
but	O
cannot	O
guarantee	O
that	O
the	O
curvature	O
condition	O
will	O
be	O
satisfied	O
by	O
the	O
chosen	O
step	O
since	O
a	O
step	O
length	O
greater	O
than	O
may	O
be	O
needed	O
to	O
satisfy	O
this	O
condition	O
.	O
</s>
<s>
Some	O
implementations	O
address	O
this	O
by	O
skipping	O
the	O
BFGS	B-Algorithm
update	O
when	O
is	O
negative	O
or	O
too	O
close	O
to	O
zero	O
,	O
but	O
this	O
approach	O
is	O
not	O
generally	O
recommended	O
since	O
the	O
updates	O
may	O
be	O
skipped	O
too	O
often	O
to	O
allow	O
the	O
Hessian	O
approximation	O
to	O
capture	O
important	O
curvature	O
information	O
.	O
</s>
<s>
Approaches	O
to	O
implementing	O
L-BFGS	B-Algorithm
using	O
the	O
direct	O
approximate	O
Hessian	O
have	O
also	O
been	O
developed	O
,	O
as	O
have	O
other	O
means	O
of	O
approximating	O
the	O
inverse	O
Hessian	O
.	O
</s>
<s>
L-BFGS	B-Algorithm
has	O
been	O
called	O
"	O
the	O
algorithm	O
of	O
choice	O
"	O
for	O
fitting	O
log-linear	O
(	O
MaxEnt	O
)	O
models	O
and	O
conditional	B-General_Concept
random	I-General_Concept
fields	I-General_Concept
with	O
-regularization	O
.	O
</s>
<s>
Since	O
BFGS	B-Algorithm
(	O
and	O
hence	O
L-BFGS	B-Algorithm
)	O
is	O
designed	O
to	O
minimize	O
smooth	O
functions	O
without	O
constraints	B-Application
,	O
the	O
L-BFGS	B-Algorithm
algorithm	O
must	O
be	O
modified	O
to	O
handle	O
functions	O
that	O
include	O
non-differentiable	O
components	O
or	O
constraints	B-Application
.	O
</s>
<s>
A	O
popular	O
class	O
of	O
modifications	O
are	O
called	O
active-set	B-Algorithm
methods	I-Algorithm
,	O
based	O
on	O
the	O
concept	O
of	O
the	O
active	B-Algorithm
set	I-Algorithm
.	O
</s>
<s>
The	O
idea	O
is	O
that	O
when	O
restricted	O
to	O
a	O
small	O
neighborhood	O
of	O
the	O
current	O
iterate	O
,	O
the	O
function	O
and	O
constraints	B-Application
can	O
be	O
simplified	O
.	O
</s>
<s>
The	O
L-BFGS-B	O
algorithm	O
extends	O
L-BFGS	B-Algorithm
to	O
handle	O
simple	O
box	O
constraints	B-Application
(	O
aka	O
bound	O
constraints	B-Application
)	O
on	O
variables	O
;	O
that	O
is	O
,	O
constraints	B-Application
of	O
the	O
form	O
where	O
and	O
are	O
per-variable	O
constant	O
lower	O
and	O
upper	O
bounds	O
,	O
respectively	O
(	O
for	O
each	O
,	O
either	O
or	O
both	O
bounds	O
may	O
be	O
omitted	O
)	O
.	O
</s>
<s>
The	O
method	O
works	O
by	O
identifying	O
fixed	O
and	O
free	O
variables	O
at	O
every	O
step	O
(	O
using	O
a	O
simple	O
gradient	O
method	O
)	O
,	O
and	O
then	O
using	O
the	O
L-BFGS	B-Algorithm
method	O
on	O
the	O
free	O
variables	O
only	O
to	O
get	O
higher	O
accuracy	O
,	O
and	O
then	O
repeating	O
the	O
process	O
.	O
</s>
<s>
Orthant-wise	O
limited-memory	O
quasi-Newton	O
(	O
OWL-QN	O
)	O
is	O
an	O
L-BFGS	B-Algorithm
variant	O
for	O
fitting	O
-regularized	O
models	O
,	O
exploiting	O
the	O
inherent	O
sparsity	B-Algorithm
of	O
such	O
models	O
.	O
</s>
<s>
Once	O
the	O
sign	O
is	O
fixed	O
,	O
the	O
non-differentiable	O
term	O
becomes	O
a	O
smooth	O
linear	O
term	O
which	O
can	O
be	O
handled	O
by	O
L-BFGS	B-Algorithm
.	O
</s>
<s>
After	O
an	O
L-BFGS	B-Algorithm
step	O
,	O
the	O
method	O
allows	O
some	O
variables	O
to	O
change	O
sign	O
,	O
and	O
repeats	O
the	O
process	O
.	O
</s>
<s>
present	O
an	O
online	B-Algorithm
approximation	O
to	O
both	O
BFGS	B-Algorithm
and	O
L-BFGS	B-Algorithm
.	O
</s>
<s>
Similar	O
to	O
stochastic	B-Algorithm
gradient	I-Algorithm
descent	I-Algorithm
,	O
this	O
can	O
be	O
used	O
to	O
reduce	O
the	O
computational	O
complexity	O
by	O
evaluating	O
the	O
error	O
function	O
and	O
gradient	O
on	O
a	O
randomly	O
drawn	O
subset	O
of	O
the	O
overall	O
dataset	O
in	O
each	O
iteration	O
.	O
</s>
<s>
It	O
has	O
been	O
shown	O
that	O
O-LBFGS	O
has	O
a	O
global	O
almost	O
sure	O
convergence	O
while	O
the	O
online	B-Algorithm
approximation	O
of	O
BFGS	B-Algorithm
(	O
O-BFGS	O
)	O
is	O
not	O
necessarily	O
convergent	O
.	O
</s>
<s>
ALGLIB	B-Library
implements	O
L-BFGS	B-Algorithm
in	O
C++	O
and	O
C#	O
as	O
well	O
as	O
a	O
separate	O
box/linearly	O
constrained	O
version	O
,	O
BLEIC	O
.	O
</s>
<s>
R	B-Language
's	O
optim	O
general-purpose	O
optimizer	O
routine	O
uses	O
the	O
L-BFGS-B	O
method	O
.	O
</s>
<s>
SciPy	B-Application
's	O
optimization	O
module	O
's	O
minimize	O
method	O
also	O
includes	O
an	O
option	O
to	O
use	O
L-BFGS-B	O
.	O
</s>
<s>
The	O
L-BFGS-B	O
variant	O
also	O
exists	O
as	O
ACM	O
TOMS	O
algorithm	O
778	O
.	O
</s>
<s>
In	O
February	O
2011	O
,	O
some	O
of	O
the	O
authors	O
of	O
the	O
original	O
L-BFGS-B	O
code	O
posted	O
a	O
major	O
update	O
(	O
version	O
3.0	O
)	O
.	O
</s>
